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
-
難度 2/5 1-3 小時 新手友好度 78/100
Textualize/textual#6753 · 1 則留言 ·
-
area: core area: docs good first issue help wanted lane: free-agent priority: P3 roadmap size: XS type: task
難度 1/5 1 小時以內 新手友好度 86/100
arminazimi/seaworthy#701 ·
維護者通常 1 天內回覆
-
Use registered media types for HDF5 and NetCDF, and stop claiming media_type must be IANA-registered未關閉documentation metadata
難度 2/5 1-3 小時 新手友好度 87/100
維護者通常 1 天內回覆
-
bug good first issue
難度 1/5 1 小時以內 新手友好度 90/100
elhajahmadj/offline-emergency-library#156 ·
維護者通常 1 天內回覆
-
7.2 user documentation (HelpHub)
難度 2/5 1-3 小時 新手友好度 72/100
WordPress/Documentation-Issue-Tracker#2559 · 1 則留言 ·