mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
MINOR: Moved onAfterSave call for LeftAndMain decorators to be called
slightly later, so FormResponses can be overridden if necessary. (from r85614) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@89224 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
b9f59ae925
commit
34ca1572d3
@ -722,10 +722,10 @@ JS;
|
|||||||
$newVersion = ((int)$record->Version) + 1;
|
$newVersion = ((int)$record->Version) + 1;
|
||||||
FormResponse::add("\$('Form_EditForm_Version').value = {$newVersion};");
|
FormResponse::add("\$('Form_EditForm_Version').value = {$newVersion};");
|
||||||
|
|
||||||
$this->extend('onAfterSave', $record);
|
|
||||||
|
|
||||||
// If the 'Save & Publish' button was clicked, also publish the page
|
// If the 'Save & Publish' button was clicked, also publish the page
|
||||||
if (isset($urlParams['publish']) && $urlParams['publish'] == 1) {
|
if (isset($urlParams['publish']) && $urlParams['publish'] == 1) {
|
||||||
|
$this->extend('onAfterSave', $record);
|
||||||
|
|
||||||
$record->doPublish();
|
$record->doPublish();
|
||||||
|
|
||||||
// Update classname with original and get new instance (see above for explanation)
|
// Update classname with original and get new instance (see above for explanation)
|
||||||
@ -752,6 +752,8 @@ JS;
|
|||||||
FormResponse::status_message($message, "good");
|
FormResponse::status_message($message, "good");
|
||||||
FormResponse::update_status($record->Status);
|
FormResponse::update_status($record->Status);
|
||||||
|
|
||||||
|
$this->extend('onAfterSave', $record);
|
||||||
|
|
||||||
return FormResponse::respond();
|
return FormResponse::respond();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user