Model Relationships: typo in example code
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 45/100
- Issue 类型
- 文档
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- php
调研方向
Read the model relationships section linked in the issue and compare its examples with the EE6 relationship definition described here. The issue reports that adding the ee: prefix to the model name fixes an unknown-model error, but asks for confirmation that this is a documentation bug. Done means verifying the behavior and correcting the examples if confirmed.
由索引模型根据 Issue 内容生成。
描述
Description of the problem
In the description of model relationships there are several examples of code used to define relationships between models. The examples all have the same basic core that looks something like this:
protected static $_relationships = array(
'Author' => array(
'model' => 'Member',
'type' => 'BelongsTo'
)
);
For EE6 at least this construct appears to be incorrect, as using this type of construct omits the ee: prefix and (at least in this authors test system) without this prefix EE will reject the relationship throwing an error of the form:
Unknown model "Member". Used in model "myAddon:Model" for a relationship called "Reln".
Adding the ee: prefix eliminates the error and leads to normal operation.
protected static $_relationships = array(
'Author' => array(
'model' => 'ee:Member',
'type' => 'BelongsTo'
)
);
However it may be that this is an issue unique to my system, so I would value observations about whether or not this is indeed a documentation bug.
If it is indeed a bug I'm happy to amend the documentation as required.
Additional context
The ee: prefix is used in relationship definitions within the EE code (e.g. in Addons\Forum\Model\Administrator.php).
- 主要语言
- CSS
- 星标
- 22
- 派生
- 79
- 平均合并
- 2 天 1 小时
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ExpressionEngine/ExpressionEngine-User-Guide 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
-
难度 1/5 1 小时以内 新手友好度 55/100
-
难度 2/5 1-3 小时 新手友好度 45/100
-
难度 1/5 1 小时以内 新手友好度 55/100
-
难度 2/5 1-3 小时 新手友好度 46/100
查看 ExpressionEngine/ExpressionEngine-User-Guide 的全部 Issue
相似的 Issue
-
Cleanup Setup可能已有人在做 @AlexanderKaran 今天认领。 未关闭documentation enhancement
难度 2/5 1-3 小时 新手友好度 64/100
e18e/framework-tracker#769 ·
维护者通常 1 天内回复
-
bug v2
难度 1/5 1 小时以内 新手友好度 88/100
modelcontextprotocol/servers#5483 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
simonw/sqlite-utils#928 ·
维护者通常 3 天内回复
-
agentic-workflows automation repo-assist
难度 1/5 1 小时以内 新手友好度 85/100
shanselman/winget-tui#483 ·
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
griptape-ai/griptape-nodes-library-elevenlabs#30 ·
维护者通常 1 天内回复