mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX reload page if broken link tracking values changed during a save. Ticket #1363
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@100722 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
abe4049c3d
commit
2128b4cf1e
@ -656,6 +656,8 @@ JS;
|
|||||||
$originalStatus = $record->Status;
|
$originalStatus = $record->Status;
|
||||||
$originalParentID = $record->ParentID;
|
$originalParentID = $record->ParentID;
|
||||||
|
|
||||||
|
$originalBrokenLinkValues = $record->HasBrokenLink.$record->HasBrokenFile;
|
||||||
|
|
||||||
$record->HasBrokenLink = 0;
|
$record->HasBrokenLink = 0;
|
||||||
$record->HasBrokenFile = 0;
|
$record->HasBrokenFile = 0;
|
||||||
|
|
||||||
@ -727,6 +729,8 @@ JS;
|
|||||||
FormResponse::add("if(\$('sitetree').setNodeParentID) \$('sitetree').setNodeParentID($record->ID, $record->ParentID);");
|
FormResponse::add("if(\$('sitetree').setNodeParentID) \$('sitetree').setNodeParentID($record->ID, $record->ParentID);");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$record->write();
|
$record->write();
|
||||||
|
|
||||||
if( ($record->class != 'VirtualPage') && $originalURLSegment != $record->URLSegment) {
|
if( ($record->class != 'VirtualPage') && $originalURLSegment != $record->URLSegment) {
|
||||||
@ -744,6 +748,11 @@ JS;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If there has been a change in the broken link values, reload the page
|
||||||
|
if ($originalBrokenLinkValues != $record->HasBrokenLink.$record->HasBrokenFile) {
|
||||||
|
FormResponse::add("$('Form_EditForm').getPageFromServer($record->ID);");
|
||||||
|
}
|
||||||
|
|
||||||
// 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);
|
$this->extend('onAfterSave', $record);
|
||||||
|
Loading…
Reference in New Issue
Block a user