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.
This patch is a continuation of #43493: FAPI: Add name/type as CSS class for form elements, which adds classes to form element wrappers. Since the form element wrapper class and ID will be essentially interchangeable (the class has slight advantages), it makes sense to remove the ID attribute entirely, since it will serve no purpose that the class does not.
Comment | File | Size | Author |
---|---|---|---|
#4 | drupal_form_element_remove_wrapper_ids.patch | 6.04 KB | quicksketch |
drupal_form_element_remove_wrapper_ids.patch | 5.16 KB | quicksketch | |
Comments
Comment #1
quicksketchNote that the ID attribute needs to actually be removed from the wrapper div in theme_form_element() also, so this still needs work that can be corrected once #43493: FAPI: Add name/type as CSS class for form elements is done.
Comment #2
sunAwesome, subscribing
Comment #3
Dries CreditAttribution: Dries commented#43493: FAPI: Add name/type as CSS class for form elements was committed.
Comment #4
quicksketchRe-rolled with the key lines removed from form.inc. After this patch, "edit-$id-wrapper" IDs are dead. The changes are all really straight-forward, but another set of eyes and searches are in order to make sure I didn't miss any and that I properly updated these.
Comment #6
quicksketchThis patch is still ready to go.
Comment #7
sunTestbot confirms.
Comment #8
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks!
Comment #10
c960657 CreditAttribution: c960657 commentedI think the fix for this issue introduced some regressions - see #550572: CSS+JS regressions related to form-item-[name].
It seems that these should have been replaced using the following pattern instead, i.e. without the
form-item
prefix: