Skip to content

Commit

Permalink
ENHANCEMENT Disabling validator in CMSMain->getCMSFields() unless its…
Browse files Browse the repository at this point in the history
… explicitly set through SiteTree->getCMSValidator(). We don't fully support validation in the CMS (yet), and it causes unnecessary bloat in the document body for now.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92660 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
chillu committed Nov 21, 2009
1 parent b96a69d commit 87a6e33
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion code/CMSMain.php
Expand Up @@ -405,8 +405,13 @@ public function getEditForm($id) {
// in the future, see http://open.silverstripe.com/ticket/2915 and http://open.silverstripe.com/ticket/3386
if($record->hasMethod('getCMSValidator')) {
$validator = $record->getCMSValidator();
// The clientside (mainly LeftAndMain*.js) rely on ajax responses
// which can be evaluated as javascript, hence we need
// to override any global changes to the validation handler.
$validator->setJavascriptValidationHandler('prototype');
$form->setValidator($validator);
} else {
$validator = new RequiredFields();
$form->unsetValidator();
}

// The clientside (mainly LeftAndMain*.js) rely on ajax responses
Expand Down

0 comments on commit 87a6e33

Please sign in to comment.