Hi,
When I was creating a form I noticed that the select list options I entered were overridden if I moved the field before I saved it.

Here's a 1:11 video showing what I mean:
http://www.screencast.com/t/fQlSVKKwm

I didn't show it in the video, but if I save the form first, then move the field, the settings are retained.

Comments

quicksketch’s picture

Thanks Brian, great report. I'm looking into this.

quicksketch’s picture

Component: Webform Itegration » Form Builder Core
Status: Active » Needs review
StatusFileSize
new5.81 KB

I've figured out the source of this problem. It's a bit convoluted, but here's the summary of how this occurs:

- Every time you drag in a new field, it adds not only the new element to the form, but replaces the "form_builder_positions" form on the page also, which is used to maintain the position of elements.
- This new form_builder_positions form uses the "action" attribute that matches the add new component path, meaning that each time the form is reordered, the menu callback for adding a new element will be fired.
- This menu callback adds a new element to the form with the exact same form key as an existing element when the form is reordered, causing the configured element to be wiped out by the fresh copy.

All of this can be avoided if we simply maintain the original "action" attribute on the positions form. While this could be fixed by some PHP foo, the easiest approach is to keep this action attribute via JavaScript. This patch corrects the problem.

quicksketch’s picture

Status: Needs review » Fixed

I've committed this patch to both branches.

Status: Fixed » Closed (fixed)

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