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.
atom_reference_field_widget_form_process()
assigns the atom dropzone markup to the #field_prefix
, wrapped inside a div.
theme_form_element()
uses spans to wrap field prefix and suffix.
The result is a div nested inside a span, which is invalid.
Comment | File | Size | Author |
---|---|---|---|
#6 | invalid_markup_atom_reference-2708991_2.patch | 8.26 KB | mario_prkos |
#5 | invalid_markup_atom_reference-2708991.patch | 3.42 KB | mario_prkos |
Comments
Comment #2
ciss CreditAttribution: ciss as a volunteer commentedComment #3
nagy.balint CreditAttribution: nagy.balint commentedAny suggestion on what could be the solution here?
Comment #4
nagy.balint CreditAttribution: nagy.balint commentedI guess we would either need to add our classes to the field prefix, or we have to use a phrasing tag instead of the div outlined here: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categori...
Comment #5
mario_prkos CreditAttribution: mario_prkos at Agence Inovae commentedThe proposed solution in this patch changes the default theme wrapper function with one custom made in atom reference module. The newly theme wrapper function changes the span element with div which at the end it fixes the markup.
The new created theme function is almost the same as default one except this small change already point out. As the result there will be minimal changes in mark up.
Comment #6
mario_prkos CreditAttribution: mario_prkos at Agence Inovae commentedThere is possible another solution for this problem. Instead of using the theme function and process function we can add just another element in field that will be contain the place for the atom drop zone. In this approach only widget form functions is modified and javascript that handles the drop zone.