mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
BUGFIX: moved $versionAuthor variable invocation into a check for the existence of the $record variable on which it depends (Ticket #4458)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@85713 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
cbaa5840c3
commit
d60fc2fdce
@ -755,8 +755,7 @@ JS;
|
|||||||
$id = $this->urlParams['ID'];
|
$id = $this->urlParams['ID'];
|
||||||
$version = str_replace('&ajax=1','',$this->urlParams['OtherID']);
|
$version = str_replace('&ajax=1','',$this->urlParams['OtherID']);
|
||||||
$record = Versioned::get_version("SiteTree", $id, $version);
|
$record = Versioned::get_version("SiteTree", $id, $version);
|
||||||
$versionAuthor = DataObject::get_by_id('Member', $record->AuthorID);
|
|
||||||
|
|
||||||
if($record) {
|
if($record) {
|
||||||
if($record && !$record->canView()) return Security::permissionFailure($this);
|
if($record && !$record->canView()) return Security::permissionFailure($this);
|
||||||
|
|
||||||
@ -765,6 +764,8 @@ JS;
|
|||||||
|
|
||||||
$fields->push(new HiddenField("ID"));
|
$fields->push(new HiddenField("ID"));
|
||||||
$fields->push(new HiddenField("Version"));
|
$fields->push(new HiddenField("Version"));
|
||||||
|
|
||||||
|
$versionAuthor = DataObject::get_by_id('Member', $record->AuthorID);
|
||||||
$fields->insertBefore(
|
$fields->insertBefore(
|
||||||
new LiteralField(
|
new LiteralField(
|
||||||
'YouAreViewingHeader',
|
'YouAreViewingHeader',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user