Enforce unique id if multiple views exposed forms are on the same page.

Created on 6 January 2022, over 2 years ago
Updated 26 September 2023, 9 months ago

Problem/Motivation

If the same views exposed form is placed on a page, the forms will both have the same id.

Steps to reproduce

Create a view with exposed filters and set "exposed form in block" to yes
Place the exposed filter block twice on a page of the site.
Inspect the form html or run a page check such as AXE. In my case both forms have the id "views-exposed-form-search-search-results"
<form action="/search" method="get" id="views-exposed-form-search-search-results" accept-charset="UTF-8" class="inline-form" data-drupal-form-fields="edit-search">

Proposed resolution

Add Html::getUniqueId() where we set the id

πŸ› Bug report
Status

Closed: duplicate

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated about 1 hour ago

Created by

πŸ‡¬πŸ‡§United Kingdom GHaddon

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.

Sign in to follow issues

Comments & Activities

Not all content is available!

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

Production build 0.69.0 2024