Deleted rows from repeat group add again after validation passed

Problems may be related, but in my problem appear deleted lines, and in your case, the lines disappear.
Besides, to me it has the same your problem.
 
I'm a little confused.

Does this only happen when your plugin is enabled, or does it happen with or without your plugin?

-- hugh
 
I enabled php plugin in video only for demonstrate data in old rows.
Without enable plugin the result is the same: rows again added after passing the validation.
 
OK, yeah, I figured this would be the issue. It's because we have a hidden input on the form, fabrik_group_rowid, which for each repeat group, lists the ids rendered with the form. Then when we do the repeat row deletion after saving groups, we do a 'diff' between the subitted ids we saved, and the fabrik_group_rowid ids, and delete the ones from fabrik_group_rowids that weren't ones we saved.

The problem of course is that on a validation fail, that fabrik_group_rowids gets rebuilt, but only with the ids present on the form now. So the ones that were on the original form aren't in fabrik_group_rowids on the final submit, so don't show up in the 'diff'.

So ... I'm working on figuring out in the code that builds that hidden variable whether we're handling a validation fail, and if so, re-use the array that was submitted with the form, rather than rebuilding it.

-- hugh
 
OK, this fix should do it:

https://github.com/Fabrik/fabrik/commit/61a9657775c15121a1d29fc6a807290303450186

So if it's a failed validation, we now re-use the fabrik_group_rowids values from the posted data (so as originally built on the first page load) rather than building it from scratch (and only including the ones that still exist after the validation fail).

So now when the form does pass validation, the delete code now gets the right diff between "ids originally on the form" and "ids that got submitted with the form".

-- hugh
 
I upgraded my website, I tested and I think that everything is working properly.
Thank you for your best support.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top