[Plugin: Cimy User Extra Fields][Bug] Profileform loses input / validation error
-
Hi Marco,
First, please accept my sincere thanks and congratulations on this plugin. Very well done!
I do however seem to run into some unexpected behavior while using it. I have read the docs, the FAQ and even part of the code trying to figure out how to solve it, but I’m not getting very far.
I’m using Cimy EUF 2.1.1 and the problem occurs in various browsers.
Problem description:
I’ve added a number of extra fields to be filled in on the user profile, such as skype, twitter etc. For a number of those fields I have added (correct) regular expressions in the “Should be equal TO:” field and I have ticked the regex box.The validation works as expected and throws errors when the input in a field doesn’t validate.
However, what I didn’t expect to happen:
If one field throws a validation error, none of the other (correctly) filled in fields are updated AND when (re-)showing the user profile form with the validation error, all previously filled in information is lost.I’m not sure whether this happens as well if you add fields to the registration form as I don’t use that function, though I would expect so.
An example to make it clearer:
Say I have added a regex for the Twitter field.
Now someone fills in an incorrect Twitter name, but also correctly fills in the fields for LinkedIN and Skype and submits the form.The form will be reloaded, will show the validation error at the top and will show the original (empty) values for the Twitter, LinkedIN and Skype fields.
Instead I would have expected the submitted form values to be shown.Now the user will have to re-fill in all the fields they previously filled in and as I have added quite a number of extra fields, this is quite inconvenient for the user.
Suggestion towards a possible solution:
When deciding the values to be shown in the user profile (and registration) form, check whether the $_POST variable exists.
If it exists, for each field check whether $_POST has a value for that field, if so, use those values, if not, use the values available in the database, if those don’t exist, use the default values if available.Please feel free to contact me if you would like me to provide more information, test a new version or even would like me to contribute some code towards the solution.
Warm greetings,
Juliette
The topic ‘[Plugin: Cimy User Extra Fields][Bug] Profileform loses input / validation error’ is closed to new replies.