Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
system.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 Jun 2009 at 00:03 UTC
Updated:
3 Jan 2014 at 00:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Everett Zufelt commentedI have moved this to base and d7 because the form labels on the Administer > Modules page are improper there and the solution can hopefully be back ported.
In Drupal 7 on the Module List and Uninstall pages both the checkbox and module name are enclosed in a label. Both labels for attribute point to the id of the checkbox input element. This does not work with many screen-readers as they are expecting only one label per form field and default to using the first label, which has no associated text or title to be communicated to the user.
The current code:
Modules List
Modules Uninstall
Recommended changes
To clarify either of the following options would allow for a screen-reader to find appropriate information to communicate to the user. I have used the above two code segments and shown the two markup options, one for each.
Wrapping only the module name in a label
The only modification in the above example is to remove the label that encloses the checkbox, this may not be possible without a change to fapi
Using the title attribute
There are two modifications in the above example. The first is to add title="Aggregator" to the checkbox input field, the second is to remove the label that encloses the module name.
Comment #2
Everett Zufelt commentedBlocked by: #522772: Improve radio and checkbox title and labeling features for accessibility
Comment #3
Everett Zufelt commentedThis patch is localized to modules/system/system.admin.inc: system_modules_build_row() and should resolve all problems related to this issue that are not covered by the blocker issue #522772: Improve radio and checkbox title and labeling features for accessibility.
1. Removes label elements that wrap the module name on administer > build > modules : list and uninstall
2. Sets the #title property of the checkbox elements to the module name. This will not appear in the page source when rendered because of the blocker issue.
Comment #4
Everett Zufelt commentedComment #5
Everett Zufelt commentedThis new patch leaves label wrapped around the module name, but removes all setting of the #title property for the checkbox element. This means that theme_checkbox will not produce a label for the checkbox and the properly associated label wrapped around the module name will be recognized by assistive technology.
Comment #6
Everett Zufelt commentedWorking on a new approach. Leaving this issue until #522772: Improve radio and checkbox title and labeling features for accessibility is fixed.
Comment #7
Everett Zufelt commentedDetermined the best current solution that is not blocked by #522772: Improve radio and checkbox title and labeling features for accessibility.
Issue:
On admin > build > modules (list and uninstall tabs) both the checkbox input element and module name are wrapped in label elements with for attribute set to the id of the checkbox element. This confuses screen-readers and no information is communicated to the screen-reader user.
Solution:
1. includes/form.inc: Modified theme_radio and theme_checkbox to only output label element if $element['#title'] is not empty, was set to if not null. This was outputting labels even when the title attribute was an empty string value.
2. modules/system/system.admin.inc: _system_modules_build_row: Removed line of code that sets #title property for checkbox to 'Enabled', as this is unset in theme_system_modules_fieldset
3. modules/system/system.admin.inc: theme_system_modules_fieldset: removed line of code that unsets $element['#title'] as it is no longer being set (see 2 above).
Summary:
As the #title is no longer being set for the checkbox, and since theme_checkbox (and theme_radio) will now only output labels on non-empty #title attributes, only the module name receives a label wrapper.
Comment #8
Everett Zufelt commentedChanging the component as administer > build > modules is part of system.module
Comment #10
mgiffordWould like to have this issue resolved. Here's a rerolled patch.
Comment #12
cliffFixed by latest patch for #558928: Form element labeling is inconsistent, inflexible and bad for accessibility (see comment #68), which has not yet been set to RTBC. Can anyone review that patch and either vouch that it is RTBC or fix any minor deficiencies to get it there?
Fixing these issues will make D7 a viable option for many governments and governmental agencies throughout North America, the United Kingdom, and the rest of Europe — anywhere that accessibility is required of them by law. This patch is a major step towards ensuring that Drupal can produce accessible Web sites.
Comment #13
mgiffordI'm setting this back to needs review as my local install of this patch didn't produce any errors in simpletest.
Comment #14
mgiffordSo should we just mark this as a duplicate of:
#558928: Form element labeling is inconsistent, inflexible and bad for accessibility
Comment #15
cliffI would think so. Other votes?
Comment #16
Everett Zufelt commentedLet's keep this open until #558928: Form element labeling is inconsistent, inflexible and bad for accessibility is fixed.
Comment #17
traviscarden commentedTagging #d7ux
Comment #18
bowersox commentedsubscribing
Comment #19
mgiffordIt's in core now with http://drupal.org/node/558928#comment-2328352