Reapply r42087

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@43181 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-10-07 22:13:50 +00:00
parent 4d0c8096cb
commit b976f99054

View File

@ -535,11 +535,9 @@ JS;
if (isset($urlParams['publish']) && $urlParams['publish'] == 1) { if (isset($urlParams['publish']) && $urlParams['publish'] == 1) {
$this->performPublish($record); $this->performPublish($record);
if(substr($SQL_id,0,3) != 'new') { $record->setClassName($record->ClassName);
$publishedRecord = DataObject::get_one($className, "`$className`.ID = {$SQL_id}"); $newClass = $record->ClassName;
} else { $publishedRecord = $record->newClassInstance($newClass);
$publishedRecord = $this->getNewItem($SQL_id, false);
}
return $this->tellBrowserAboutPublicationChange($publishedRecord, "Published '$record->Title' successfully"); return $this->tellBrowserAboutPublicationChange($publishedRecord, "Published '$record->Title' successfully");
} else { } else {
@ -559,6 +557,7 @@ JS;
*/ */
public function getActionUpdateJS($record) { public function getActionUpdateJS($record) {
// Get the new action buttons // Get the new action buttons
$tempForm = $this->getEditForm($record->ID); $tempForm = $this->getEditForm($record->ID);
$actionList = ''; $actionList = '';
foreach($tempForm->Actions() as $action) { foreach($tempForm->Actions() as $action) {