BUGFIX Limiting readonly transformation of form in CMSMain->EditForm() to fields only (excluding actions). FormAction readonly transformations were fixed a while ago, which meant that they were actually enforced now, causing unavailable cms actions in certain scenarios (e.g. with a page deleted from live, which should make the fields readonly, but leave buttons functional)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@68754 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-12-13 21:04:35 +00:00 committed by Sam Minnee
parent 7b2fe32587
commit 9845cadb3b

View File

@ -421,7 +421,10 @@ JS;
$form->loadDataFrom($record);
$form->disableDefaultAction();
if(!$record->canEdit() || $record->DeletedFromStage) $form->makeReadonly();
if(!$record->canEdit() || $record->DeletedFromStage) {
$readonlyFields = $form->Fields()->makeReadonly();
$form->setFields($readonlyFields);
}
return $form;
} else if($id) {