Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Patch #15 in #131432: #field_prefix and #field_suffix work on textfields only made field prefixes and suffixes available to more form elements, but at the same time moved the field prefix away from begin directly next to the field. Instead, it's *before* the label while it should be directly before the textfield. The attached patch moves the #field_prefix/suffix to the correct location.
Comment | File | Size | Author |
---|---|---|---|
#7 | 755030_field_prefix_suffix.patch | 4.43 KB | jhedstrom |
#4 | 755030_field_prefix_suffix.patch | 4.26 KB | jhedstrom |
#4 | prefix-suffix-without-patch.png | 26.04 KB | jhedstrom |
#4 | prefix-suffix-with-patch.png | 25.15 KB | jhedstrom |
#2 | 755030_field_prefix_suffix_2.patch | 1.82 KB | Sivaji_Ganesh_Jojodae |
Comments
Comment #1
sundoh! :)
This patch is RTBC - but this entire issue/regression probably means that we need tests :-/
Comment #2
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedThe patch works as expected but it fails to apply with error message
Attached is patch re-rolled from latest build. #762074: Page for editing a shortcut shows the site URL in a weird place and #766562: label element after field-prefix are duplicate of this.
Comment #3
cburschkaSubscribing to this.
The patch looks ready. I'll see about writing a test later today...
Comment #4
jhedstromI started writing some tests, and when I did, realized I'm not sure of the ideal behavior here. Attached is a patch with some tests, but they aren't passing. Also attached are 2 screenshots. The first one, without the patch, the second with the patch. The patch doesn't appear to be moving the prefix/suffix's at all. Moreover though, in D6 and the way it works now, prefix/suffix have wrapped the entire element, including the label. Changing this seems like it would lead to unexpected behavior.
Comment #5
kkaefer CreditAttribution: kkaefer commentedThis patch is about #field_prefix/suffix, not about #prefix or #suffix. These two properties are distinct. #field_prefix is used for example for placing a value *directly* on the same line of a textfield. #prefix is used to place content before the entire widget. That also means that the tests are not testing for #field_prefix but for #prefix (which didn't change in this patch).
Comment #6
jhedstromAh, that makes more sense. I'll update the patch tomorrow with valid tests.
Comment #7
jhedstromHere's the patch with proper tests for #field_prefix and #field_suffix. Also, since I'd already done half the work for #prefix/#suffix tests, I added those as well.
Comment #8
sunThanks, looks good!
Comment #9
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.