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.
I'm not sure if this works as designed, but after I checked the "Load a pre-built option list", selected US states for example, and save it, I can't edit it anymore; everything seems fixed. For instance, I can't uncheck "Load a pre-built option list" when I got a bug related to the option element module, or uncheck Allow "Other..." option.
Also, I set the label inline, but it displays as above.
Screenshots are attached.
Thanks again!
Comment | File | Size | Author |
---|---|---|---|
#15 | webform_1565618.patch | 854 bytes | Liam Morland |
#15 | select_or_other_1565618.patch | 936 bytes | Liam Morland |
#13 | webform_1565618.patch | 1.42 KB | Liam Morland |
#13 | select_or_other_1565618.patch | 1.29 KB | Liam Morland |
#7 | select_or_other_webform_inline_1565618.patch | 1.4 KB | Liam Morland |
Comments
Comment #1
Liam MorlandThe first issue is addressed in #1513894: Pre-built options lists do not work with Options Element.
Comment #2
Liam MorlandThe second issue is a Webform issue, not an Options Element issue.
Comment #3
DrupalDan CreditAttribution: DrupalDan commentedsorry for that. Thanks for letting me know about this.
Comment #4
DrupalDan CreditAttribution: DrupalDan commentedI closed this issue at options_element module page as it seems that it's a webform issue, so I re-open it here. Sorry it I shouldn't.
Thanks
Comment #5
Liam MorlandI can't reproduce this problem. The label element should be contained in a div element with @class webform-container-inline. That class should give the label display: inline. Please use a tool like Firebug to check your stylesheet to see if there is something overriding that style rule.
Comment #6
DrupalDan CreditAttribution: DrupalDan commentedHi Liam, it' great to hear from you. I used firebug and checked, but it seems that there is no overriding for that part.
Also, I don't know if this is relevant, but when I unchecked Allow "Other..." option, the label goes inline, which is I want, but whenever I check that, the selection area just drops down as the screenshot shows. Do you think this means anything particular?
Thanks~
Comment #7
Liam MorlandYes, that is very relevant. The attached patch fixes the problem with a small change to Select (or other).
Comment #8
DrupalDan CreditAttribution: DrupalDan commentedHi Liam, thanks for the patch. That's awesome! It perfectly fixes the problem. Thanks again for the effort!
Comment #9
danielb CreditAttribution: danielb commentedWhy does webform use a #title_display value of 'inline' instead of 'before'? Would it not be better to fix that in webform?
Comment #10
Liam MorlandInline has the label display to the left of the form control. Before has it display above.
Comment #11
Liam MorlandTo be more clear: Webform supports "inline", "before", and "none". "before" means above and "inline" means next to it. The Webform-specific theming function handles "inline" but the regular theming function used to expand the Select (or other) control does not so we have to convert "inline" to "before". Webform will still add the CSS class that does the inline display.
Comment #12
danielb CreditAttribution: danielb commentedOh I see 'inline' is something extra webform supports that is not normally in FAPI?
It does appear there is a bug with #title_display in select_or_other based on what I see in your patch, however supporting 'inline' explicitly on this side of the integration seems out of place since that is a webform specific feature.
Comment #13
Liam MorlandI see what you mean. Attached is a patch for each of Select (or other) and Webform; both patches together fix the issue and keep the inline-specific code in Webform.
Comment #14
quicksketchThere are still lots of other components that use #title_display = 'inline', we can't just change theme_webform_element() based on select lists, since it's used for all components. Switching the #title_display property for select_or_other in webform_expand_select_or_other() seems like a good alternative approach, as that's where Webform makes its other adjustments to select_or_other to make it work with Webform.
Comment #15
Liam MorlandThanks, quicksketch. Here is another pair of patches using webform_expand_select_or_other().
Comment #16
danielb CreditAttribution: danielb commentedThanks Liam. I've committed your patch. Select or other's next dev snapshot will set the #title_display on the select list that is passed to the parent element too.
Note that you can also set this property on the 'other' field using #other_title_display on the parent element.
Comment #17
quicksketchThanks both Liam and danielb: Committed the Webform portion to both 3.x branches of Webform.