Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Forms: labels of the editor fields and the festival forms point to a field that does not exist

未关闭
#620 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@guidol-ive 已经在做这个了。

开始于 2026年10月28日。

  • #624 来自 @guidol-ive —— 未关闭

评估

难度
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 内容生成。

描述

Component: User interface Impact: Low Level: Easy Pagetype: Festival Pagetype: Peer reviewed article Type: Bug Value: Users

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:1087 already 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 a name.

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 as main is 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,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PlanBCode/hypha 的其他 Issue

查看 PlanBCode/hypha 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。