Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Using Honeypot, the added field id attribute leaks to its wrapper div causing an ID duplication.
Steps to reproduce
- Install Drupal and Honeypot
- Go to a page where a protected form is
- In the source code, search for
id="edit-url"
Expected: only one occurence
Current: two occurences
Proposed resolution
For the div to have a 'null' id to avoid that parameter leaking.
Remaining tasks
Patch, Review, Commit
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#4 | interdiff.2884445.2.4.txt | 469 bytes | DuaelFr |
#4 | honeypot_avoid-id-duplication_2884445-4.patch | 426 bytes | DuaelFr |
| |||
#2 | honeypot_avoid-id-duplication_2884445-2.patch | 409 bytes | DuaelFr |
|
Comments
Comment #2
DuaelFrComment #3
DuaelFrIt seems that it does not work...
Comment #4
DuaelFrOK! I got it!
Comment #5
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commented@DuaelFr - Thanks for the patch! Can you provide a few steps I can run through to verify the problem, then make sure the patch fixes it? (e.g. 1. Visit a page with a honeypot field in a form. 2. View source and search for "xyz" 3. Note that a div two levels up has the same ID) — that helps me not have to dig around for the context so I can review the patch more quickly. Thanks!
Comment #6
DuaelFrThank you for your quick answer :)
I updated the IS with steps to reproduce.
Comment #7
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedChecking it out today. Thanks!
Comment #8
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedConfirmed the bug, and tested the fix. Thanks!
Comment #10
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedComment #11
DuaelFrThanks :)