Merge pull request #863 from kinglozzer/2449-getcmsvalidator-restore-pages-fix

FIX Don't validate pages when restoring or reverting (fixes silverstripe/silverstripe-framework#2449)
This commit is contained in:
Ingo Schommer 2013-10-09 01:53:47 -07:00
commit c3e25e9e07

View File

@ -634,6 +634,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
$form->addExtraClass('center ' . $this->BaseCSSClasses()); $form->addExtraClass('center ' . $this->BaseCSSClasses());
// if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet'); // if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
$form->setAttribute('data-pjax-fragment', 'CurrentForm'); $form->setAttribute('data-pjax-fragment', 'CurrentForm');
// Set validation exemptions for specific actions
$form->setValidationExemptActions(array('restore', 'revert', 'deletefromlive', 'rollback'));
// Announce the capability so the frontend can decide whether to allow preview or not. // Announce the capability so the frontend can decide whether to allow preview or not.
if(in_array('CMSPreviewable', class_implements($record))) { if(in_array('CMSPreviewable', class_implements($record))) {