View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0006010||OXID eShop (all versions)||1. ----- eShop frontend -----||public||2015-01-06 15:40||2017-06-29 11:13|
|Product Version||4.8.8 / 5.1.8|
|Target Version||Fixed in Version|
|Summary||0006010: Form validation does not check whether a dynamic form field has any values or not|
|Description||If you add "oxuser__oxstateid" to the aMustFillFields for the registration and a country does not have a state you will get an error message.|
Validation should only take effect if the selected country has got a state to select.
|Steps To Reproduce||Go into the OXID admin-> Master Settings-> Core Settings-> Settings -> Other Settings -> Mandatory fields in User Registration Form.|
Add "oxuser__oxstateid" right there.
Then go to the registration page and try to register with a country, which does not have a state to select.
|Tags||No tags attached.|
|PHP Version||Not defined|
|Database Version||Not defined|
I changed the subject slightly to clarify to topic. This behavior is not specific to the oxuser__oxstateid field, but applies to any dynamic form field. A dynamic form field is a field which can have different values, depending on the value of another form field.
In this particular case, the values of the oxuser__oxstateid field change depending on the country which was selected (as obviously Germany has other states than the US, for example).
We created a form validation which is as generic as possible, but can be extended for project specific needs. You could write a module which enhances the stock validator by this feature. The place to extend should be this one: http://goo.gl/TbJeAk
From my point of view, this is a feature enhancement: Extend the validator in such a way that it is aware of dynamic fields and validates those fields only if there are any options (=values) to display at all. I will put it on our Product Backlog, and we would be happy to get a contribution for this.
As for now, we should update our documentation and point out that adding a dynamic field to the $aMustFillFields might have side effects, if the dynamic field does not have any values.