-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-inline validation only half works #1155
Comments
Chat GPT suggested using "standalone block" as the opposite of "inline block". |
This was referenced Apr 29, 2024
PR merged. Neeeeeeext! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While working on inline-validation for elemental it was discovered that the current state of validation for non-inline saving is pretty bad
Validation on page save
Page save is somewhat busted.
MyBlock::validate()
style validation does work .. however the validation message will show at the top of the page rather than on the element as described in this bugMyBlock::getCMSCompositeValidator()
akaRequiredFields
validation doesn't seem to work, nor doesFormField::validate()
- I tried putting a UrlField on my block which has its own validate() method though I could save invalid values.Validation on "not inline" block.
I assume that "not inline" block means setting private static $inline_editable = false;
It's just a regular DataObject EditForm at this point. It work much better than blocks on the Page EditForm, though RequiredFields is still a bit busted because instead of a nice red error message you get a red toast that says "validation error" and no indication of what's invalid.
Same issue with a toast showing when adding a message via
Model::validate()
usingaddError()
, as opposed toaddFieldError()
which does work OKAcceptance criteria
Related
Multi PR CI
Note that the endtoend cms failures are existing
PRs
The text was updated successfully, but these errors were encountered: