Files sidebar: tag creation error ignores the "restrict to admins" setting
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript
- 领域
- frontend
调研方向
阅读 apps/systemtags/src/components/SystemTags.vue 第 163–171 行附近的错误处理,并与 SystemTagPicker.vue 进行比较;issue 指出后者使用了正确的状态查询。更新限制检查,并确保两个错误分支都会重置加载状态。为错误消息和加载状态添加测试,然后运行相关的 systemtags 组件测试。
由索引模型根据 Issue 内容生成。
描述
Bug description
When creating a tag in the Files sidebar fails, SystemTags.vue decides on the error message by reading the creation restriction from the initial state of the settings app:
In Files this state is provided by the systemtags app (LoadAdditionalScriptsListener / BeforeTemplateRenderedListener), the settings one only exists on the admin server settings page. So the value is always false here and users always get the generic "Failed to create tag" instead of "System admin disabled tag creation. You can only use existing ones." In addition, the early return in that branch skips loading.value = false, so once the app id is fixed the component would stay in the loading state after this error.
Steps to reproduce
Found by code reading.
- As admin, restrict tag creation to admins.
- As a regular user, try to create a new tag from the Files sidebar.
- "Failed to create tag" is shown.
Expected behavior
The state is read via loadState('systemtags', 'restrictSystemTagsCreationToAdmin', false) (as SystemTagPicker.vue does), the loading state is reset in both branches, and this is covered by a test.
Nextcloud version
master
- 主要语言
- PHP
- 星标
- 37.7k
- 派生
- 5.4k
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 585
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nextcloud/server 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
1. to develop bug feature: federation
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
1. to develop bug feature: files feature: previews and thumbnails
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
1. to develop bug feature: dashboard
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
1. to develop bug feature: sharing
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 1/5 1 小时以内 新手友好度 92/100
-
难度 1/5 1 小时以内 新手友好度 91/100
nhrrob/nhrrob-secure#35 ·
-
area/tests type/bug when/soon
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复