Do not duplicate HTML IDs

Created on 23 August 2021, about 3 years ago
Updated 26 November 2023, 12 months ago

Problem/Motivation

Duplicate HTML IDs were reported in a11y tests of the module output. The Mailchimp Signup module assigns an HTML DOM ID to the parent div of the signup form, but this is the same DOM ID that the form is assigned.

Steps to reproduce

- Drupal 9 + Mailchimp 2.0.2 + Radix subtheme
- Place Mailchimp Signup block on page (in footer)
- Check HTML for `id="mailchimp-signup-subscribe-block-subscribe-for-updates-form"` ("subscribe_for_updates" is the MailchimpSignup entity ID on this site).
- Two instances appear:

<div id="mailchimp-signup-subscribe-block-subscribe-for-updates-form">
<form action="/" method="post" id="mailchimp-signup-subscribe-block-subscribe-for-updates-form" accept-charset="UTF-8">

Proposed resolution

Apply a DOM ID which is not the same as the form's ID.

Remaining tasks

- [x] Patch
- [ ] Review
- [ ] Merge

User interface changes

HTML ID changes might occur, affecting themeing which targets IDs. (However, theme application should ideally target classes not IDs, so this may not be a concern.)

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Signup Module

Created by

πŸ‡³πŸ‡ΏNew Zealand xurizaemon Ōtepoti, Aotearoa 🏝

Live updates comments and jobs are added and updated live.
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.

Production build 0.71.5 2024