Browse files

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
  • Loading branch information...
1 parent b96a69d commit 87a6e331e902a128ff69877a0aaa9b1c881df838 @chillu chillu committed Nov 21, 2009
Showing with 6 additions and 1 deletion.
  1. +6 −1 code/CMSMain.php
View
7 code/CMSMain.php
@@ -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

0 comments on commit 87a6e33

Please sign in to comment.