BUGFIX: fixed site page restoration

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@71250 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Will Rossiter 2009-02-03 01:37:21 +00:00 committed by Sam Minnee
parent 5a7b5fd7fa
commit 7a027eb753

View File

@ -413,7 +413,6 @@ JS;
}
}
}
$form = new Form($this, "EditForm", $fields, $actions);
$form->loadDataFrom($record);
$form->disableDefaultAction();
@ -576,7 +575,7 @@ JS;
*/
public function revert($urlParams, $form) {
$id = (int)$_REQUEST['ID'];
$record = Versioned::get_one_by_stage('SiteTree', 'Live', "\"SiteTree_Live\".\"ID\" = {$id}");
$record = Versioned::get_one_by_stage('SiteTree', 'Live', "`SiteTree_Live`.`ID` = {$id}");
// a user can restore a page without publication rights, as it just adds a new draft state
// (this action should just be available when page has been "deleted from draft")
if($record && !$record->canEdit()) return Security::permissionFailure($this);