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

Closed
wants to merge 1 commit into
from

Projects

None yet

4 participants

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

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

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

@simonwelsh
Contributor

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

@chillu
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
Member
sminnee commented Aug 29, 2012

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

@sminnee
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 chillu closed this Mar 18, 2013
@petpack petpack pushed a commit to petpack/silverstripe-cms that referenced this pull request Jul 14, 2016
Petpack github #178: initial work for PHP7 compatibility c48b55f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment