mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
MINOR: Fixed notice-level error in rollback. (from r90260)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@96804 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
4567f66a0a
commit
df0bc2ff73
@ -729,6 +729,7 @@ JS;
|
|||||||
*/
|
*/
|
||||||
function rollback() {
|
function rollback() {
|
||||||
if(isset($_REQUEST['Version']) && (bool)$_REQUEST['Version']) {
|
if(isset($_REQUEST['Version']) && (bool)$_REQUEST['Version']) {
|
||||||
|
$this->extend('onBeforeRollback', $_REQUEST['ID']);
|
||||||
$record = $this->performRollback($_REQUEST['ID'], $_REQUEST['Version']);
|
$record = $this->performRollback($_REQUEST['ID'], $_REQUEST['Version']);
|
||||||
echo sprintf(_t('CMSMain.ROLLEDBACKVERSION',"Rolled back to version #%d. New version number is #%d"),$_REQUEST['Version'],$record->Version);
|
echo sprintf(_t('CMSMain.ROLLEDBACKVERSION',"Rolled back to version #%d. New version number is #%d"),$_REQUEST['Version'],$record->Version);
|
||||||
} else {
|
} else {
|
||||||
@ -890,6 +891,7 @@ JS;
|
|||||||
if($page && !$page->canView()) return Security::permissionFailure($this);
|
if($page && !$page->canView()) return Security::permissionFailure($this);
|
||||||
|
|
||||||
$record = $page->compareVersions($fromVersion, $toVersion);
|
$record = $page->compareVersions($fromVersion, $toVersion);
|
||||||
|
|
||||||
$fromVersionRecord = Versioned::get_version('SiteTree', $id, $fromVersion);
|
$fromVersionRecord = Versioned::get_version('SiteTree', $id, $fromVersion);
|
||||||
$toVersionRecord = Versioned::get_version('SiteTree', $id, $toVersion);
|
$toVersionRecord = Versioned::get_version('SiteTree', $id, $toVersion);
|
||||||
if(!$fromVersionRecord) user_error("Can't find version $fromVersion of page $id", E_USER_ERROR);
|
if(!$fromVersionRecord) user_error("Can't find version $fromVersion of page $id", E_USER_ERROR);
|
||||||
|
Loading…
Reference in New Issue
Block a user