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