Details
-
Task
-
Resolution: Unresolved
-
Minor
-
None
-
None
Description
Refactor checkWriteDependencies to beforesave() and checkDeleteDependencies to beforedelete().
Note return(false) will generate "Please recheck the highlighted fields", which is not the best error message. One way to address this might be to set a flash message in beforesave/delete, and then not use the default error in StandardController if save fails. Or maybe throw an exception.
Also, checkWriteDependencies is passed $curdata, which beforesave/delete does not by default have access to.
See Model/EmailAddress.php::beforeSave() as a potential template.