Skip to content
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

BUG: open ticket 7537 Fixing Validation\Exception errors #178

Closed
wants to merge 1 commit into from

Conversation

kmayo-ss
Copy link
Contributor

@kmayo-ss kmayo-ss commented Aug 8, 2012

Amendments so that Validation\Exceptions are caught when editing a page

http://open.silverstripe.org/ticket/7537

@simonwelsh
Copy link
Contributor

@sminnee Did anything come of catching ValidationExceptions thrown in an action method by the form and returned as a failed validation?

@chillu
Copy link
Member

chillu commented Aug 29, 2012

It seems a bit brittle to wrap every write() call in a try/catch, particularly when you include indirect calls through publish() etc. - for example, this fix missed write() requests in AssetAdmin, and I'm sure lots of other places :)

We could catch those on a higher level in LeftAndMain->handleRequest(), but don't have access to the form object at that point. Simon's suggestion of doing it in the form action itself would catch most ocurrences, and AFAICT will still work with the CMS routing and display logic, since we've overloaded the redirect() method.

@sminnee
Copy link
Member

sminnee commented Aug 29, 2012

Simon's point is valid. Hold up, I'll dig something up.

@sminnee
Copy link
Member

sminnee commented Aug 29, 2012

This is what I had done - I found the gist https://gist.github.com/2467965

It's from 23 April so it might not apply cleanly. I'll have to check my home machine to see if I have it on a proper branch there.

Initially, we were concerned with it conflicting with the work that others had "in progress". Whatever became of the GSOC form validation project?

@chillu
Copy link
Member

chillu commented Mar 18, 2013

@chillu chillu closed this Mar 18, 2013
petpack pushed a commit to petpack/silverstripe-cms that referenced this pull request Jul 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants