insighty / openesignforms

Automatically exported from code.google.com/p/openesignforms
0 stars 0 forks source link

Rename document field causes errors if not also renamed in document ${field} notation #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a document with a field called ${firstName}
2. Click Save so the field is auto-created.
3. Click on the field created, and rename to customerFirstName.
4. Click Save.

What is the expected output? What do you see instead?
Expect to see the firstName field renamed to customerFirstName, but since I 
didn't rename the field in the document itself, when I click Save, I should 
also get a new auto-created field called customerFirstName (with 1 reference) 
and the firstName field should have a reference count of 0.

Logs indicate there is a duplicate key violation.

Original issue reported on code.google.com by yoz...@gmail.com on 13 May 2011 at 6:55

GoogleCodeExporter commented 8 years ago
Fixed in 0.9.6.

Code had a duplicate key because the page editor auto-created a field with the 
original name (since it wasn't changed in the document itself), plus it had the 
previous field that was renamed, but since the renamed update took place after 
the insert of the new field, we'd get a duplicate key violation. Changed the 
order to first delete all fields that were deleted, then update all changed 
field, then add in all new fields.

Original comment by yoz...@gmail.com on 13 May 2011 at 10:19