Closed (fixed)
Project:
Form Builder
Version:
7.x-1.2
Component:
Form Builder Core
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Sep 2012 at 19:44 UTC
Updated:
10 Oct 2012 at 22:11 UTC
Jump to comment: Most recent file
Comments
Comment #1
quicksketchThanks Brian, great report. I'm looking into this.
Comment #2
quicksketchI'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.
Comment #3
quicksketchI've committed this patch to both branches.