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.
If it is not a bug, I am not sure why it is there...
I have seen it only in the "Select options" component.
I have disabled them through hook_form_alter:
// In options field - this look like a bug - only displayed in this component (inside Position fieldset)
$form['position']['weight']['#access'] = FALSE; // the field
$form['position']['#access'] = FALSE; // the fieldset
Comment | File | Size | Author |
---|---|---|---|
#8 | webform-select_position-2536426-6.patch | 1.35 KB | DanChadwick |
#2 | position.png | 61.46 KB | Amir Simantov |
Comments
Comment #1
DanChadwick CreditAttribution: DanChadwick commentedI don't understand the issue. Please describe in much more detail. I am guessing that you are using some webform add-on module which is presenting its own interface for editing components.
Webform supplies the position and weight fields for when the user has disabled javascript and cannot use drag-and-drop. The jQuery on the page will then hide these fields. Perhaps you have a javascript error on the page which is causing the scripts to stop running.
Feel free to reopen with lots more information. Otherwise, I'll consider this to be an answered support request.
Comment #2
Amir Simantov CreditAttribution: Amir Simantov commentedThis is not in the all components page. Rather, it is in the component edit page of a specific 'select' component, as written in the title.
Comment #3
DanChadwick CreditAttribution: DanChadwick commentedThis is correct behavior. It allows you to change the position in the form. It also lets you nets components within fieldset components.
Comment #4
Amir Simantov CreditAttribution: Amir Simantov commentedIf so, why does it appear only in the 'select' component edit page and not in the edit page of none of the other components?
Comment #5
DanChadwick CreditAttribution: DanChadwick commentedReproduced. I'm not sure why this isn't being hidden by the CSS. Needs more investigation.
Comment #6
Amir Simantov CreditAttribution: Amir Simantov commentedI think that in the component edit page itself (not the page where all components are listed) the control should be by php and not by css. That is - in the theming phase.
Comment #7
DanChadwick CreditAttribution: DanChadwick commentedI don't understand this comment. The Position fieldset is added by the server to the component edit for for each component. This allows a user without Javascript to adjust the position of each component and its surrounding fieldset. If javascript is enabled, then this fieldset is hidden by css. The 'js" class is added by javascript to the html tag so that elements like position may easily be hidden with css.
The required css seems to be missing from the select component. I haven't investigated why yet.
Comment #8
DanChadwick CreditAttribution: DanChadwick commentedThis issue is that Select components add #attached items to the form, which overwrites the #attached webform admin library. Fixed to avoid this. Committed to 7.x-4.x and 8.x.
Comment #10
Amir Simantov CreditAttribution: Amir Simantov commentedSee this image again - where do you see js here? This issue is NOT regarding the page where all components are listed!
Also, I
Also, the patch is not relevant.
I wanted to help so I have documented this bug, it is not something I need for myself - I have shared my solution in the first message. As I do not want to play this game of opening and closing the issue, I quit from it.
Comment #11
DanChadwick CreditAttribution: DanChadwick commentedAmir, you seem frustrated. I appreciate that you reported a bug. I initially didn't understand that it applied only to the edit page for the select component. Once I understood that, I reproduced the issue, found the cause, fixed it, and committed the fix.
Here is how this all works:
Every component has a Position fieldset on its edit component page. This is how someone who has javascript disabled in their browser can adjust the position (weight) and parent when they cannot use the javascript drag-and-drop interface on the component list page.
When javascript is enabled, there is no reason to display the position and weight on the component edit page. The way this is hidden is via CSS. The reason the bug affects only the select component is because due to the way that #attached form elements are incorporated from the component-specific form into the general component form, the select component's attached was overwriting the general component's attached. This caused the CSS to not be included on the select component edit page, which caused the position fieldset to be shown.
Furthermore, the patch selected in #1 would disable the above feature, removing the ability of a user who does not have javascript to edit the position and parent.
The screen shot you posted has javascript running. I can tell because the fieldset has the collapse/expand arrow, which is added by javascript.
The patch I committed does indeed fix the problem and in the correct manner. Try it and you'll see.
Comment #12
Amir Simantov CreditAttribution: Amir Simantov commentedOK, thanks for the explanation. I think that when you have referred to js the second time, you were still talking about the page where components are listed.