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
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DanChadwick’s picture

Category: Bug report » Support request
Status: Active » Fixed

I 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.

Amir Simantov’s picture

Status: Fixed » Active
FileSize
61.46 KB

This 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.

Position

DanChadwick’s picture

Status: Active » Fixed

This is correct behavior. It allows you to change the position in the form. It also lets you nets components within fieldset components.

Amir Simantov’s picture

Status: Fixed » Active

If so, why does it appear only in the 'select' component edit page and not in the edit page of none of the other components?

DanChadwick’s picture

Category: Support request » Bug report

Reproduced. I'm not sure why this isn't being hidden by the CSS. Needs more investigation.

Amir Simantov’s picture

I 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.

DanChadwick’s picture

I 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.

I 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.

DanChadwick’s picture

Version: 7.x-4.10 » 7.x-4.x-dev
Status: Active » Fixed
FileSize
1.35 KB

This 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.

  • DanChadwick committed a529d53 on 7.x-4.x
    Issue #2536426 by DanChadwick: Position fieldset are displayed in "...
  • DanChadwick committed dda9991 on 8.x-4.x
    Issue #2536426 by DanChadwick: Position fieldset are displayed in "...
Amir Simantov’s picture

See 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.

DanChadwick’s picture

Amir, 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.

Amir Simantov’s picture

OK, 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.