Forms: labels of the editor fields and the festival forms point to a field that does not exist
维护者通常 1 天内回复
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- html, php
调研方向
Read system/core/editor.php at loadEditor() (lines 179–194), then inspect the festival form fields in system/datatypes/festival.php at the listed lines. A linked pull request already contains the fix; the issue reports a browser test using the mailing list editor that fails on main and passes on the branch.
由索引模型根据 Issue 内容生成。
描述
Rule. <label for="x"> must refer to the id of a form field. Chrome reports a label whose for matches no id
(FormLabelForMatchesNonExistingIdError) or matches only a name (FormLabelForNameError) in its Issues panel;
clicking the label does nothing and a screen reader does not connect label and field.
In Hypha the for of a label is also how HTMLForm finds the label of a field by name (scanForm(),
system/core/document.php:429), so the value must stay the field name; the field needs that name as its id.
Places (upstream/main d97ab7b):
system/core/editor.php:179-194,loadEditor(): an<editor name="...">becomes<textarea class="wymeditor">
without an id. Affected labels:
system/datatypes/peer_reviewed_article.php:1667, 1679, 1684, 1689(excerpt, text, method, sources) and
system/datatypes/mailinglist.php:1049, 1052(description, email_welcome_text).
(mailinglist.php:1087already gives its editor an id and is not reported.)system/datatypes/festival.php:399, 404, 409, 414(default sign-up form) and
661, 666, 671, 678, 684, 689, 701(default contribution form): inputs with only aname.
Evidence. Issues panel, PHP 8.2 and 8.5, desktop and phone:
FormLabelForNameError / FormLabelForMatchesNonExistingIdError <label for="excerpt">uittreksel</label> (article edit, 4 labels)
FormLabelForNameError / FormLabelForMatchesNonExistingIdError <label for="description"> omschrijving </label> (mailing list edit, 2 labels)
FormLabelForNameError / FormLabelForMatchesNonExistingIdError <label for="name">Naam van organisator / presentator</label> (festival contribute, 7 labels)
The sign-up form cannot be opened on main because of #548, but has the same pattern.
Fix.
- In
loadEditor(), give the textarea its name as id when it has no id and no other element on the page has that id
(checked with XPath, so an existing id such asmainis never duplicated). - In the two default festival forms, add
id="[[field-name-...]]"to each field; the label of the image points to the
file input, which is the field the user operates.
A pull request with the fix follows (commit "forms: Give the fields of the editor and the festival forms the id their label points to"), tested on PHP 8.2 and 8.5 with a browser test that reads the Issues panel (fails on main, passes on
the branch). The article edit view of a new, empty article gives a fatal error on main (#525), so the test uses the
mailing list editor, which goes through the same loadEditor() code.
Related: #264 (simplify form generation).
Found by a crawl of every page type with Chrome, reading the console and the Issues panel, as visitor, member and administrator, on desktop and phone.
🤖 Generated with Claude Code
- 主要语言
- JavaScript
- 星标
- 5
- 派生
- 9
- 平均合并
- 18 小时 7 分钟
- 30 天内合并 PR
- 11
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PlanBCode/hypha 的其他 Issue
-
Component: User interface Impact: Low Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
Impact: Medium Level: Easy Type: Bug Value: Users
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
Impact: Medium Level: Easy Pagetype: Mailinglist Type: Bug Value: Users
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
Impact: Low Level: Easy Type: Bug Value: Coders
难度 1/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
相似的 Issue
-
step.duration reflects only the last retry attempt (HelperStep.run() overwrites startTime)可能已有人在做 @mirao 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
codeceptjs/CodeceptJS#5774 · 1 条评论 ·
维护者通常 2 天内回复
-
Status: Unconfirmed
难度 1/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
AllTheMods/ATM10-Aeronautics#151 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
feimacode/open-design-agent-kit#66 ·
维护者通常 1 天内回复