BUGFIX: Fixed Versioned::publish() when the class name is bad, for example after a module has been removed.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@80933 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-07-03 01:21:13 +00:00
parent 1b1809f1a2
commit 57bb3c09d7

View File

@ -426,10 +426,10 @@ class Versioned extends DataObjectDecorator {
$extTable = $this->extendWithSuffix($baseClass);//die($extTable);
if(is_numeric($fromStage)) {
$from = Versioned::get_version($this->owner->class, $this->owner->ID, $fromStage);
$from = Versioned::get_version($baseClass, $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($baseClass, $fromStage, "\"{$baseClass}\".\"ID\" = {$this->owner->ID}");
}
$publisherID = isset(Member::currentUser()->ID) ? Member::currentUser()->ID : 0;