Bug #57885

Inputs are cleared from a second form if the first form produced a vallidation error

Added by Nicholas Gray over 6 years ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-04-13
Due date:
% Done:

0%

Estimated time:
Has patch:
No

Description

Hi,

we ran in to the following Bug:

What is needed:
-A fluid template containing 2 forms (form A and B).
-Both forms are containing values from a stored object

How to reproduce the error:
- Update one form (form A) so that it will produce a validation error

Result/Reason:
- The other form (form B) will no longer contain the filled in values from the stored object as the formfield viewhelpers search for these in last submitted input array. This array only contains the inputs of the form (form A) which produced the error and thus form B is filled in with empty values

Fix:
Quickly hacked together (please refer to the attached 3 files)...
Each form is now extended with an unique ID which is checked in the hasValidationErrors method. Thus only the fields of the form producing the error will return true and the fields of other forms are filled in as usual. The ID simply generated by counting how often the form tag was called. There is certainly a better way to handle it but that was the best I could come up with. I hope it helps

Best regards


Files

patch.tar.gz (6.75 KB) patch.tar.gz Nicholas Gray, 2014-04-14 00:00

No data to display

Also available in: Atom PDF