Primiry sub tag != secondary tags
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- php
- 领域
- authorization, backend
调研方向
从 tag 扩展中检查 tag 是否为 secondary 的部分开始,重点关注 issue 中描述的 position 和 parent_id 条件。复现列出的设置和创建 discussion 的步骤,然后验证带有 primary subtag 的 primary tag 可以在没有权限错误的情况下被接受,并且选定的 parent 关系得到了正确处理。
由索引模型根据 Issue 内容生成。
描述
Current Behavior
If I want people to create discussions using at minimum one primary tag and at minimum one primary subtag, it doesn't work properly because the primary subtag doesn't equal the secondary tag.
It gives an error about lack of permission.
Steps to Reproduce
- Create a primary tag and put a primary subtag in it
- In the settings specify minimum primary tags 1 and minimum secondary tags 1
- Try to create a discussion by specifying one primary tag and a primary subtag
- It will give a permissions error
Expected Behavior
When you create a discussion using at minimum one primary tag and one primary sub tag the discussion should create and not give permission errors
Screenshots
No response
Environment
- Flarum version: 1.8.7
- Webserver: nginx/1.18
- Hosting environment: vps
- PHP version: 8.3.8
- Browser: Firefox 131
Output of php flarum info
No response
Possible Solution
After reviewing the open-source code of the tag extension, I concluded that the check for whether a tag is secondary is done through "tags.position == null".
However, primary subtags have a position, and to fix this, we need to use the following check: "tags.position == null || tags.parent_id != null".
This way, primary subtags will also be considered as secondary tags, as they currently should be.
I also believe we need to check if "tags.parent_id != null" and if the parent of this tag is included in the selected tags.
Additional Context
No response
- 主要语言
- PHP
- 星标
- 6.8k
- 派生
- 891
- 平均合并
- 1 天 10 小时
- 30 天内合并 PR
- 209
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
flarum/framework 的其他 Issue
-
type/accessibility type/bug
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
Default language is ignored for anyone who chose a language, when the language selector is hidden可能已有人在做 @1AbdullahButt 于 15 天前认领。 未关闭type/bug
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
[2.x] False CLI/Web PHP mismatch when /usr/bin/php differs from the site's FPM可能已有人在做 @lazerg 于 15 天前认领。 未关闭type/bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
[2.x] A filter on a resource without a searcher returns a 500可能已有人在做 @imorland 今天认领。 未关闭type/bug
flarum/framework#5578 · 已指派 1 人 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 87/100
维护者通常 1 天内回复
-
Add php 8.6未关闭
难度 1/5 1 小时以内 新手友好度 66/100
mailersend/mailersend-php#199 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Configuration new tool
难度 2/5 1-3 小时 新手友好度 68/100
novalo-dev/Prestashop-MCP-Server#366 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 10 天内回复