mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Small change in versioned to help it work with subsites
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@40235 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ee3c18afcf
commit
801b94b3bf
@ -279,11 +279,10 @@ class Versioned extends DataObjectDecorator {
|
|||||||
$from = Versioned::get_version($this->owner->class, $this->owner->ID, $fromStage);
|
$from = Versioned::get_version($this->owner->class, $this->owner->ID, $fromStage);
|
||||||
} else {
|
} else {
|
||||||
$this->owner->flushCache();
|
$this->owner->flushCache();
|
||||||
$from = Versioned::get_one_by_stage($this->owner->class, $fromStage, "`{$baseClass}`.ID = {$this->owner->ID}");
|
$from = Versioned::get_one_by_stage($this->owner->class, $fromStage, "`{$baseClass}`.`ID` = {$this->owner->ID}");
|
||||||
}
|
}
|
||||||
|
|
||||||
$publisherID = isset(Member::currentUser()->ID) ? Member::currentUser()->ID : 0;
|
$publisherID = isset(Member::currentUser()->ID) ? Member::currentUser()->ID : 0;
|
||||||
|
|
||||||
if($from) {
|
if($from) {
|
||||||
$from->forceChange();
|
$from->forceChange();
|
||||||
if(!$createNewVersion) $from->migrateVersion($from->Version);
|
if(!$createNewVersion) $from->migrateVersion($from->Version);
|
||||||
|
Loading…
Reference in New Issue
Block a user