- Issue created by @mandclu
- @mandclu opened merge request.
- Status changed to Needs review
over 1 year ago 9:18am 27 March 2023 - Status changed to Needs work
over 1 year ago 12:13pm 5 April 2023 - π¨π¦Canada mandclu
Moving this to the 2.0.x branch. Also, I think we need to figure out how to suppress these errors instead of just hiding them via CSS.
I know that the preview is built from the form state, which itself has methods available related to validation, namely:
setValidationEnforced()
setLimitValidationErrors()
setValidationComplete()I tried using those within a copy of the form state in this module's compilePreview() function and then sending that to the tempstore $store_private->set() call at the end of the function, but it didn't seem to work. If we can get it working, however, I think this approach would be much better.
- Status changed to Fixed
over 1 year ago 9:36pm 8 June 2023 - πΊπΈUnited States brianperry
I believe this is also addressed in 2.1.x - marking as fixed.
- Status changed to Needs work
over 1 year ago 10:20pm 8 June 2023 - π¨π¦Canada mandclu
Tested this in 2.1.0 and it still exhibits the same behavior.
- πΊπΈUnited States brianperry
Whoops my bad. On initial load in Gin with the preview open by default I don't see the validation error, but I do see it if I refresh the preview.
- π¨π¦Canada mandclu
The error that I find most disruptive to the user experience is the error thrown when using an image field, such as when creating an article with a standard install of Drupal. You see the preview and everything thing looks great, but once you upload an image the only thing you see is the error about missing alt text.
IIRC I also tried this with Inline Form Errors installed, but it still didn't work, though that was with an older version.
- First commit to issue fork.
- Merge request !50Issue #3350571: Suppress validation errors being shown in the preview β (Open) created by dieterholvoet
- Status changed to Needs review
over 1 year ago 8:49pm 24 July 2023 - π§πͺBelgium dieterholvoet Brussels
I started a new MR targeting 2.1.x, removing all status messages.
- Status changed to Needs work
over 1 year ago 11:10am 25 July 2023 - π¨π¦Canada mandclu
Before the patch, an image field breaks the preview when an image is uploaded, showing only the validation error:
After the patch, the validation error isn't shown, but the preview is not show either. The result is even more confusing to the user, since it is effectively a black preview:
We need to actually suppress the errors, not just hide them.
- Status changed to Needs review
over 1 year ago 10:58am 29 July 2023 - π§πͺBelgium dieterholvoet Brussels
I was able to successfully suppress all validation errors by decorating and adding preview form-specific logic to the
form_error_handler
service. - Status changed to RTBC
over 1 year ago 11:50am 29 July 2023 - π¨π¦Canada mandclu
This is great, and works exactly the way I had hoped.
- πΊπΈUnited States cosmicdreams Minneapolis/St. Paul
Back in action, reviewing...
- Status changed to Needs work
over 1 year ago 4:48pm 7 August 2023 - π§πͺBelgium dieterholvoet Brussels
I just found out this suppresses all errors on node forms.
- Status changed to Needs review
over 1 year ago 4:57pm 7 August 2023 - πΊπΈUnited States cosmicdreams Minneapolis/St. Paul
I'll have to manually test this.