BUGFIX Avoid reloading CMS form twice after certain saving actions (fixes #5451, thanks muzdowski)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@113692 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-11-13 02:12:48 +00:00 committed by Sam Minnee
parent c19aa2ce85
commit e8e5c62c5a

View File

@ -732,7 +732,8 @@ JS;
// Removed virtualpage test as we need to draft/published links when url is changed
if( (/*$record->class == 'VirtualPage' &&*/ $originalURLSegment != $record->URLSegment) ||
($originalClass != $record->ClassName) || self::$ForceReload == true) {
FormResponse::add("$('Form_EditForm').getPageFromServer($record->ID);");
// avoid double loading by adding a uniqueness ID
FormResponse::add($str = "$('Form_EditForm').getPageFromServer($record->ID);", $str);
}
// After reloading action
@ -765,7 +766,8 @@ 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);");
// avoid double loading by adding a uniqueness ID
FormResponse::add($str = "$('Form_EditForm').getPageFromServer($record->ID);", $str);
}
// If the 'Save & Publish' button was clicked, also publish the page
@ -1305,4 +1307,4 @@ JS;
}
?>
?>