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
This commit is contained in:
Ingo Schommer 2009-11-21 02:38:39 +00:00
parent b96a69d716
commit 87a6e331e9

View File

@ -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