Model Relationships: typo in example code
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- php
- Lĩnh vực
- documentation
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- CSS
- Star
- 22
- Fork
- 79
- Merge trung bình
- 2 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ExpressionEngine/ExpressionEngine-User-Guide
-
Inconsistent code block spacingĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
-
registration form docsĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 55/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
-
Clarify autosave interval valueĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 55/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 46/100
Tất cả issue của ExpressionEngine/ExpressionEngine-User-Guide
Issue tương tự
-
agentic-workflows automation repo-assist
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
shanselman/winget-tui#483 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
griptape-ai/griptape-nodes-library-elevenlabs#30 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
docs: Release playbookĐang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
awslabs/social-messaging-agent-runtime-toolkit#140 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
liberation-data/drivine-python#432 ·
Maintainer thường phản hồi trong vòng 1 ngày