BUGFIX #3065: Fixed restore page

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@66067 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-11-17 21:58:29 +00:00
parent 555ee1549b
commit 325ef6fe34

View File

@ -578,12 +578,12 @@ JS;
public function revert($urlParams, $form) {
$id = $_REQUEST['ID'];
$obj = DataObject::get_by_id("SiteTree", $id);
$record = DataObject::get_by_id("SiteTree", $id);
if($record && !$record->canEdit()) return Security::permissionFailure($this);
$obj->doRevertToLive();
$record->doRevertToLive();
$title = Convert::raw2js($obj->Title);
$title = Convert::raw2js($record->Title);
FormResponse::get_page($id);
FormResponse::add("$('sitetree').setNodeTitle($id, '$title');");
FormResponse::status_message(sprintf(_t('CMSMain.RESTORED',"Restored '%s' successfully",PR_MEDIUM,'Param %s is a title'),$title),'good');