elofgren: BUGFIX: Fix "Fatal error: Call to a member function Actions() on a non-object in LeftAndMain?.php on line 489" error encountered after creating a new page and clicking "Save & Publish".

This bug was caused by r40178. 
(merged from branches/gsoc)


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42085 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-09-16 15:06:05 +00:00
parent c0a7eba5ab
commit c09e518635

View File

@ -487,11 +487,9 @@ JS;
if (isset($urlParams['publish']) && $urlParams['publish'] == 1) {
$this->performPublish($record);
// BUGFIX: Changed icon sometimes shows after "Save & Publish" button is clicked http://support.silverstripe.com/gsoc/ticket/31
if(substr($id,0,3) != 'new') {
$publishedRecord = DataObject::get_one($className, "`$className`.ID = $id");
} else {
$publishedRecord = $this->getNewItem($id, false);
}
$record->setClassName( $record->ClassName );
$newClass = $record->ClassName;
$publishedRecord = $record->newClassInstance( $newClass );
return $this->tellBrowserAboutPublicationChange($publishedRecord, "Published '$record->Title' successfully");
} else {
// BUGFIX: Changed icon only shows after Save button is clicked twice http://support.silverstripe.com/gsoc/ticket/76