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.
Hello,
I use Select or other for taxonomy. The functionality is OK so far.
Unfortunately, the label of the form is displayed twice.
Did you get the error already discovered?
I have in select_or_other.module (version = "7.x-3.x-dev") function: function select_or_other_element_process the line 94 is disabled (- '# title' => $ element ['# title'])
Now the label is present only once.
Would appreciate some feedback.
regards
Twuli
Comment | File | Size | Author |
---|---|---|---|
#23 | 2165467-webform-only-one-label-23.patch | 612 bytes | torotil |
|
Comments
Comment #1
huijing CreditAttribution: huijing commentedMy issue is sort of different. I am using the other option on a list of select options, and my issue is the label doesn't display at all. Inspecting source shows that there is an ".element-invisible" class on the label, and there are 2 of them, one which is the default label that is generated by webform and one is within the div generated by select or other.
I'm not sure how to patch this issue so I hacked a workaround via jquery (I'm so certain this is wrong, but I need it to work). Basically, I just removed ".element-invisible" from one of the labels using this:
$(".select-or-other .form-type-radios").find("label:first-of-type").removeClass("element-invisible");
I'd really like to know how this issue can be patched properly though.
Comment #2
legolasboI'm unable to reproduce this issue with the latest development version. Please reopen and add clear steps to reproduce the problem if this is still an issue.
Comment #3
Adrian Richardson CreditAttribution: Adrian Richardson commentedI am experiencing the original problem described by twuli when using the latest 3.x-dev version with webform 4.7. There is an extra rendering of a title label which does not include the required status. Webform uses webform_element for a theme wrapper on select elements instead of form_element so the hook_process_form_element is never called.
I'm attaching a patch which uses a pre_render callback to control the rendering of the title on only the original element (and not the created 'select' child element) together with the required status marker.
Comment #4
guster-von CreditAttribution: guster-von commentedI was seeing the same duplicate label occur on Webform.
It is gone after applying the patch.
Thanks!
Comment #5
bartmann CreditAttribution: bartmann commentedNot using Webform, but in the add node we were getting duplicate labels - patch has fixed this.
Comment #6
legolasboDuplicate labels have been occurring several times over the history of this module. It would be great if a regression test could be added to prevent this from happening in the future.
Comment #7
legolasboComment #8
bkno CreditAttribution: bkno commentedPatch works for me. Would be good for this to get committed.
Comment #9
legolasboComment #11
legolasboPatch #3 did not apply correctly anymore so I had to reroll it. Let's see what testbot thinks about it with the new regression tests added in #10.
Also still needs tests for the webform integration.
Comment #13
legolasboAs I suspected, this patch breaks the existing functionality for non-webform elements and therefor needs work.
Comment #14
penone CreditAttribution: penone commentedAny update on this issue?
Comment #15
legolasboNot on my end. I've been busy with the D8 version. will probably end up backporting a lot of the work that has been done there, since it's been rebuilt from scratch, but I'm not sure if that would fix this issue. Haven't run into double labels in the D8 version though.
Comment #16
SaintNexcis CreditAttribution: SaintNexcis commentedThe patch on #3 worked for me in removing the double label, however I'd like to point out that the "extra label" is actually the label for the Other text field that appears when one selects Other. I believe this because prior to patching I could get it to only show ONE label as long as I didn't select the option to allow "Other...". If this is true (I haven't traced it in the code) then the label is being applied incorrectly as I would imagine that it should state Other, not the Parent Label.
Also, the patch worked for me by means of applying it manually... I'm currently running Version: 7.x-3.0-alpha1+18-dev.
Comment #17
DRIVE CreditAttribution: DRIVE commentedThought I saw a note that a patch was pushed to 7.x-3.x-dev. Applied #3 manually and all set. Thank you!
Comment #18
amh5514 CreditAttribution: amh5514 commented#3 works after you manually applying the patch. There was a closing bracket the patch failed to remove with the function in the Pre-render callback section - around line 213
Comment #19
LIQUID VISUAL CreditAttribution: LIQUID VISUAL commentedI have two labels in select options field in webform if I enable the "or other" option. I'm using Select or other 7.x-3.0-alpha1+19-dev and Webform 7.x-4.14+25-dev. Example at http://conf.liquidvisual.ca/content/invitation-test-webform if anyone has tip or patch.
Comment #20
DRIVE CreditAttribution: DRIVE commentedLIQUID VISUAL - https://www.drupal.org/node/2165467#comment-11874883 your test site is down
Comment #21
LIQUID VISUAL CreditAttribution: LIQUID VISUAL commentedThis worked for me when I set up the fields correctly. Why do I have product variations but no product types? Is that normal?
Where can I find out why I am unable to make commerce products a translatable entity even though I have the right modules enabled? When I select Commerce Product to be a translatable entity, it does not appear as a tab in the lower left of the settings page.
Comment #22
FiNeX CreditAttribution: FiNeX as a volunteer commentedHi, with the patch the label is shown once but the input text box is always visible.
Comment #23
torotil CreditAttribution: torotil at more onion commentedHere is a patch that implements a process callback for
theme_webform_element()
.Note that the existing comment for
select_or_other_process_form_element()
is actually wrong as this is not a hook but a theme process function.Comment #24
alibama CreditAttribution: alibama commented@torotil - thank you = this fixed webform + select other for me