OptionRule does not properly (server-side) validate custom list fields #39210
Unanswered
stephan-ansems
asked this question in
General
Replies: 1 comment
-
Base on what I see from the code of OptionsRule, it will be possible. The easiest way would be your own custom field class has a implement magic That method would need to return list of options available for your field so that Joomla can validate the submitted data. As this is not an issue with Joomla but it is your own field type implementation, I'm moving this issue to discussion so that we can discuss further from there if needed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Steps to reproduce the issue
Create a custom field
«component»\src\Field\DatacenterField.php
which loads has a helper method to get the options values from the database. Then create a form where the fueld is declared like this:Click 'save' and get an error...
Expected result
Serverside validation as the option is selected from the list of options provided and not somehow injected
Actual result
A message stating 'Invalid field: «field name»'.
System information (as much as possible)
The issue is somewhere in the OptionsRule.php as this is the rule supposed to validate the input. It seems the OptionsRule looks at the xml definition of the field, but this lacks the valid options.
Additional comments
Possibly server-side validation is not possible for custom list fields, but this is not very clear.
Beta Was this translation helpful? Give feedback.
All reactions