From e8e5c62c5ad9c55418708be927732c7dadbe1343 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 13 Nov 2010 02:12:48 +0000 Subject: [PATCH] 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 --- code/LeftAndMain.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php index 044b2528..eddf6f2f 100644 --- a/code/LeftAndMain.php +++ b/code/LeftAndMain.php @@ -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; } -?> \ No newline at end of file +?>