Test that all form elements have a title for accessibility

Created on 6 October 2010, over 13 years ago
Updated 23 April 2024, about 2 months ago

Issue summary updated through comment #142.

Problem

To ensure that all form elements are accessible, we need a mechanism to ensure that #title is set up for all the form elements that should use it, so that defining that form element without using #title is not possible.

There was a proposal to create an abstracted "Property Validation API" that can be used to verify that all the required properties of a certain element have been set properly. This was rejected since the feature was only useful when developers are building the form, and is needless code execution otherwise.

Proposed resolution

In #128, tstoeckler suggested a core test that would check every module's forms and ensure that relevant form elements have a #title attribute. This would prevent any new core from being added without necessary #title attributes, since those forms would not pass this test.

Remaining tasks

  1. mikey_p suggested on IRC, Current AccessibilityTest checking may probably fail for quite a few forms, notably any entity form. Need to do something to get all the entity forms via the entityform system / EntityFormBuilder. Here's some code that attempts to work with any entity form: http://cgit.drupalcode.org/formblock/tree/src/Plugin/Block/EntityFormBlo...
  2. Reroll #134 removing sections that have been solved by #1987726: Convert language content page related callback to new style controller β†’
  3. or possibly start over.
<!-- See https://drupal.org/core-mentoring/novice-tasks for tips on identifying novice tasks. Delete or add "Novice" from the Novice? column in the table below as appropriate. Uncomment tasks as the issue advances. Update the Complete? column to indicate when they are done, and maybe reference the comment number where they were done. -->

Original report

In #882694: Add missing form element titles for accessibility β†’ @Sun suggested that a mechanism be put in place to ensure that all form fields have a #title.

the proper fix for D8 is to additionally require a non-empty #title for all form elements via form_builder(), throwing an exception or error message if one without is encountered, so as to ensure that every form is accessible.

EDIT: That is, because Form API is not able to throw a form validation error for a form element without #title. You simply see the same form, without any error message.(http://drupal.org/node/882694#comment-3513452)

πŸ“Œ Task
Status

Needs work

Version

11.0 πŸ”₯

Component
FormΒ  β†’

Last updated about 6 hours ago

Created by

πŸ‡¨πŸ‡¦Canada Everett Zufelt

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • Merge request !7659Accessible titles β†’ (Open) created by nicxvan
  • Pipeline finished with Failed
    about 2 months ago
    Total: 177s
    #153869
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    I've updated this to an MR. I had to handle the removal of Book.

    I also changed the deprecation removal notice to 11.x I'm not sure if that is correct.

    Hiding all patches.

  • Pipeline finished with Failed
    about 2 months ago
    Total: 162s
    #153878
  • Pipeline finished with Failed
    about 2 months ago
    Total: 176s
    #153879
  • Pipeline finished with Failed
    about 2 months ago
    #153880
  • Pipeline finished with Failed
    about 2 months ago
    Total: 178s
    #153884
  • Pipeline finished with Canceled
    about 2 months ago
    Total: 189s
    #153887
  • Pipeline finished with Running
    about 2 months ago
    #153889
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    Ok this still needs work there are a lot of test failures.

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan
Production build 0.69.0 2024