[2.x] Tags: one way for extensions to tell primary from secondary tags
Maintainer thường phản hồi trong vòng 1 ngày
@Saksham-chourasia đang làm issue này rồi.
Từ ngày 13/11/2026.
- #5504 của @Saksham-chourasia — đang mở
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Start with the backend and frontend Tag models, then trace the position checks named in the tags extension: GlobalPolicy, DiscussionResourceFields, Content\Tags, the admin and forum Tags pages, addTagList, addTagComposer, TagSelectionModal, and sortTags. Compare their existing checks with is_primary and the stated counting rules; the issue lists the required helpers, query scopes, compatibility behavior, and documentation updates. Done when these checks use the helpers, secondary tag positions remain null in 2.x, and the deprecation is documented.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Extensions, and the tags extension itself, decide whether a tag is primary by checking position: a secondary tag has none. That ties the tag's kind to its order, which stops secondary tags from ever being ordered (#5236), and the check is repeated in about ten places, with small differences.
Tags already store the kind in is_primary, exposed as isPrimary in the API and Tag.isPrimary() in JS. A child of a primary tag is a primary tag: is_primary is true for it, as it is for its parent.
Proposal
On the backend Tag model and the frontend Tag model:
isPrimary(): a primary tag or a child of one, read fromis_primary.isChild(): a child of a primary tag.isPrimaryParent(): a primary tag without a parent (frontend already has it).isSecondary():!isPrimary().- Backend query scopes
Tag::query()->primary()and->secondary().
Then:
- Move every check in the tags extension from
positionto these:GlobalPolicy,DiscussionResourceFields,Content\Tags, the admin and forum Tags pages,addTagList,addTagComposer,TagSelectionModalandsortTags. - Keep
positionnull for secondary tags in 2.x, so extensions that check it keep working, and mark that check deprecated in the changelog and the extension docs. - The required tag counts keep their behaviour: top-level primary tags count as primary, every other tag (children included) towards the secondary limits. Name it that way in code and docs rather than calling children secondary.
This depends on repairing is_primary: the admin edit modal currently clears it when saving an existing tag. That repair is included in the work on #5236.
The permission mismatch and child-tag counting discussion already have #4065 and #3640; this proposal supplies consistent helpers without deciding a new counting policy.
- Ngôn ngữ chính
- PHP
- Star
- 6.8k
- Fork
- 891
- Merge trung bình
- 1 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 209
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không 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 flarum/framework
-
type/accessibility type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Default language is ignored for anyone who chose a language, when the language selector is hiddenCó thể đã có người làm @1AbdullahButt đã nhận 15 ngày trước. Đang mởtype/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[2.x] False CLI/Web PHP mismatch when /usr/bin/php differs from the site's FPMCó thể đã có người làm @lazerg đã nhận 15 ngày trước. Đang mởtype/bug
Độ 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
-
Độ 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
-
[2.x] A filter on a resource without a searcher returns a 500Có thể đã có người làm @imorland đã nhận hôm nay. Đang mởtype/bug
flarum/framework#5578 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của flarum/framework
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 87/100
Sylius/Sylius#19359 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add php 8.6Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 66/100
mailersend/mailersend-php#199 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Tool: somcp_delete_currencyĐang mởConfiguration new tool
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
novalo-dev/Prestashop-MCP-Server#366 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 10 ngày