Re-ordering doesn't take
craigkendall - February 16, 2009 - 06:13
| Project: | Webform |
| Version: | 6.x-2.6 |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
Dragging form components and hitting the submit button to save doesn't have any effect on the items. They stay in the order before re-ordering.

#1
Discovered after playing with it, the re-ordering doesn't appear to work when you are placing items under a fieldset. So the re-ordering appears to work fine when not grouping items under sets/headings.
#2
I'm not seeing this problem. I can reorder fields and save them just fine under node/x/edit/components. Are you upgrading from a previous version or did you just install Webform?
#3
I have installed webforms 2.6 the very first time and also cannot drag and drop fields. If I drag them the position is lost after a save. Dragging them to a fieldset also doesn't keep them inside the fieldset. It falls back the the main level.
Adding an element via component edit to a fieldset works.
#4
Okay I've reproduced the issue of *sometimes* saving the groupings of fields. Seems like I can always reorder fields just fine, but moving an item from within a fieldset to the root level does not take.
For example, given the hierarchy below, if I move Item 1 to the root level (but only at the top) it doesn't save.
- Item A- Item 1
- Item 2
- Item 3
- Item B
to
- Item 1- Item A
- Item 2
- Item 3
- Item B
Doesn't save. If you can come up with any other specific scenarios that don't work it might help me track down the problem.
#5
For me it was the following situation:
- Item A- Item 1
- Item 2
- Item 3
and I tried to move item 3 inside the fieldset A:
- Item A- Item 3
- Item 1
- Item 2
One strange thing I saw - after I moved "Item 3" successful via the component settings page to the fieldset A I'm now able to move it inside and ouside the fieldset and to different weight positions... seems not a always broken functionality or only if never dragged... no real idea.
#6
I have experienced this as well. I was excited to see that the dragging allowed me to quickly move a bunch of components into a fieldset... only to be disappointed to find out it didn't save the moves. :(
#7
Below is the output of my form.
My issue is with the attachment (file) field. You will see that the
$form['submitted']['attachment']['attachment']['#weight'] => 5This reflects it's intended order - the same order as the fields in the field array.
But then I see
$form['submitted']['attachment']['#weight'] => 0.006Also, I am using 2.4 -- so it's showing up there, too.
In the meantime, I am overriding the sort order by using hook_form_alter()
#8
Drupal.org didn't like the form array I was trying to include to the bottom of my message in #7, so I'm attaching it here.
#9
I had this problem too.
The first time I had the problem I shifted the fieldset to the top of the list, put its items "inside" it, saved, and it worked. Then moved it where I needed it in the list and it continued to work.
On a second form, I created the fieldset, put the item/s in it, save, and it doesn't work. I tried adding items (so it wasn't at the bottom), but can't get the items into the fieldset at all.
Saving bounced them back into a flat list.
==
I went back to make sure that 'configuration' was saved (it wasn't), saved it, came back to 'components' and tried to arrange them again. No luck.
==
I turned off "mandatory" on the two fields I was trying to move.
They moved into the field set. The rearrangement saved.
I set them to mandatory again, and saved, and all is well.
My conclusion: you cannot move mandatory fields into a fieldset.
#10
I have a similar problem, but it has nothing to (for me) with whether or not fields are marked Mandatory. Seeing as this was reported in February, has anyone solved it yet?
I did confirm that editing the component directly (bypassing the d-n-d) saves correctly.
#11
Same problem here!
So.....Bump!
#12
Bumping isn't going to do anything. I've got almost 400 issues to look through. If you'd really like to help, submit a patch or hire a developer to submit a patch.
#13
The quick solution is to move your fieldset to the very top, then individually drag each child field into said fieldset, then save. Now move the fieldset back to where it's meant to be and save again.
This has worked for me so far.
Edit: you can also drag the 'new field' item into any fieldset before adding a field, and it should work persistently for each new field.
#14
The attached patch should fix this problem. I was having the same issue with not being able to nest items within a fieldset and this takes care of it.
#15
This comparison doesn't look right, are you really intending to do an assignment here?
+ if ($component['pid'] = $form_state['values']['components'][$cid]['pid'] ||#16
Gah! You're right. Here it is with the appropriate comparison. Tested this version as well and it appears to work as expected.
The problem is that when you drag and drop a component into a fieldset, and do nothing else, the only thing that has changed is the components pid. In that case the submission doesn't get past the if statement at line 245, and thus webform_component_update($component) never gets called.
#17
eojthebrave, I couldn't get drag and drop working with the patch you supplied, I think the comparison was now backwards, it should be a
!=comparison, not a==comparison. I've changed it and applied the attached patch.#18
@ quicksketch - nice! Just had this problem today, and the patch seems to fix it.
#19
This patch managed to slip into the 2.7 version that was released for a security fix, so it's already included in the latest stable.
#20
Automatically closed -- issue fixed for 2 weeks with no activity.