We had an issue when adding an invalid Validator expression in a module field (e.g. a string field), when editing that field, we got the mentioned error.
Also it was not possible to remove the invalid validator expression in the module field. It was not visible anymore in the UI. Also it was not possible to add new validators in this field.
The only thing that helped, was editing on database level. => Removing the validator expression from the compose_module_field table row.
Is this a known issue? Is there a better workaround or will this be fixed anytime soon?
Corteza Version is 2024.9.1
Could you please show how you configured the validation?
I have just configured it to test, and I can confirm that it works as expected.
So this is probably an issue that affects only you. The question is why.
My best guess is probably some misconfiguration.
Here is an example from the database table compose_module_field: Column “expressions”
{"validators": [{"test": "(isEmpty(FachlicheFreigabe_am) && isEmpty(FachlicheFreigabe_von))) || (!isEmpty(FachlicheFreigabe_am) && !isEmpty(FachlicheFreigabe_von)))", "error": "dfg", "validatorID": "1"}, {"test": "dfgfg", "validatorID": "2"}, {"validatorID": "3"}, {"validatorID": "4"}, {"validatorID": "5"}, {"validatorID": "6"}, {"validatorID": "7"}, {"validatorID": "8"}, {"validatorID": "9"}, {"validatorID": "10"}, {"validatorID": "11"}, {"validatorID": "12"}, {"validatorID": "13"}, {"validatorID": "14"}, {"validatorID": "15"}, {"validatorID": "16"}]}
Looks wild, but we tried to provoke the error and e.g. with this configuration it was not possible to edit validation for that field anymore. Click on “New” doesn’t add a new validation field and there is nothing shown to edit:
Also the mentioned error unexpected EOF… is shown on validation.
The only thing that helps in this situation ist resetting the database field expressions to {}
You can also provoke this error, when adding a random string as validation expression.
I think there should be some validation for validation expressions on saving in Corteza?
I can replicate it now, I see that it doesn’t filter out empty validators for some reason…
Will fix that for 2024.9.3
Thanks for raising this issue!
1 Like