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:
Sam Minnee 2007-08-16 06:38:15 +00:00
parent ee3c18afcf
commit 801b94b3bf

View File

@ -279,11 +279,10 @@ class Versioned extends DataObjectDecorator {
$from = Versioned::get_version($this->owner->class, $this->owner->ID, $fromStage);
} else {
$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;
if($from) {
$from->forceChange();
if(!$createNewVersion) $from->migrateVersion($from->Version);