WCAG 2.0 says "The first element inside the fieldset must be a legend element..." but the fieldsets generated by custom_search/includes/forms.inc do not include legend elements. This causes a failure on accessibility check. Seems like it ought to be easy to add a legend for each fieldset.

CommentFileSizeAuthor
#2 custom-search-fieldset.patch1.01 KBmgifford

Comments

jdanthinne’s picture

Patches are welcome, but they need to be done in such a manner that they don't break existing themes...

mgifford’s picture

Status: Active » Needs review
Issue tags: -WCAG 2.0 +wcag2
StatusFileSize
new1.01 KB

Ok, so it setting it up here http://simplytest.me/project/custom_search

How would I replicate this problem in the settings admin/config/search/custom_search

Drupal 7 uses fieldsets to create collapsible form elements. Details is being used for this in most cases in D8 instead.

This should add the title

        // Popup.
        $form['popup'] = array(
          '#type'       => 'fieldset',
          '#title' => 'Custom search',
          '#weight'     => 1 + variable_get('custom_search_' . $delta . 'search_box_weight', 0),
          '#attributes' => array('class' => array('custom_search-popup')),
        );

But I don't think you'd actually want to see the <legend> expressed and I don't think you can set the #title_display on a fieldset in D7.

Anyways, just to get this issue moving along.....

jdanthinne’s picture

Status: Needs review » Needs work

Perhaps a best to do that is to let people choose their title via the admin. They would also choose the visibility of the title, and if they don't want to see it, hide it visually, but not in the code, via CSS.

mgifford’s picture

Version: 6.x-1.12 » 7.x-1.x-dev

That's always better. Also, probably best to fix this in D7 first and then backport it.

mgifford’s picture

Issue tags: -wcag2 +WCAG
loon’s picture

Status: Needs work » Closed (outdated)

D7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.

If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.

Thanks!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.