ValidationException
from addons doesn't get caught by forms AJAX handling. Is this intentional?
#10375
Replies: 1 comment 5 replies
-
What is the actual issue this is causing for you? can you share code that shows it? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
😄 An unusual issue I stumbled across after having a chat with @martyf, @robdekort and @duncanmcclean - figured it was worth starting a discussion!
As far as I can tell many Statamic addons that throw form errors all throw a
ValidationException::withMessages
: eg;This works well for normal Statamic forms, but is incompatible with the Statamic AJAX error responses, as these are made before the addon code exception is thrown. This can result in unusual (or broken?) forms, or errors being turned in different JSON responses:
(normal error response)
(addon error response)
This is all slightly above my pay grade, but from my understanding Statamic responds to the AJAX form requests in a fairly Statamic way, as opposed to a Laravel way. I was wondering if there was some sort of way that this gap could be bridged? Or failing that if there was any way to adapt the addons to be able to hook in? 🤷♂️
Beta Was this translation helpful? Give feedback.
All reactions