From 87a6e331e902a128ff69877a0aaa9b1c881df838 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 21 Nov 2009 02:38:39 +0000 Subject: [PATCH] ENHANCEMENT Disabling validator in CMSMain->getCMSFields() unless its 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 --- code/CMSMain.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/CMSMain.php b/code/CMSMain.php index df776cb4..9800fca2 100755 --- a/code/CMSMain.php +++ b/code/CMSMain.php @@ -405,8 +405,13 @@ JS; // 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