From a6087f1d4eccc8cdf795a215d32472b66258d889 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Wed, 8 Aug 2012 17:04:17 +1200 Subject: [PATCH 1/2] FIXED: Issue where links within the CMS page list view would not be correctly generated. E.g. when the translatable module is used, page links for the "show children" action would come up as admin/pages/?locale=en_NZ?ParentID=21&view=list when they should be shows as admin/pages/?locale=en_NZ&ParentID=21&view=list. Uses Controller::join_links to perform the necessary sanity check on urls. --- code/controllers/CMSMain.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index 9c00727d..e01e0175 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -710,9 +710,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr $num = $item ? $item->numChildren() : null; if($num) { return sprintf( - '%s', - $controller->Link(), - $item->ID, + '%s', + Controller::join_links($controller->Link(), "?ParentID={$item->ID}&view=list"), $num ); } From 7807842eb185f7c875a1957106f5764f32c2c487 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Tue, 21 Aug 2012 15:50:03 +1200 Subject: [PATCH 2/2] FIXED: Additional issue where the add-page ajax parameters wouldu incorrectly concatenate additional query parameters into the add action url. Resolved by moving URL concatenation from view to controller where Controller::join_links is available --- code/controllers/CMSMain.php | 8 ++++++-- templates/Includes/CMSMain_TreeView.ss | 2 +- .../Includes/CMSPagesController_ContentToolActions.ss | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index e01e0175..ef9ff9ec 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -202,8 +202,12 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr return $link; } - function LinkPageAdd() { - return singleton("CMSPageAddController")->Link(); + function LinkPageAdd($extraArguments = null) { + $link = singleton("CMSPageAddController")->Link(); + $this->extend('updateLinkPageAdd', $link); + if($extraArguments) + $link = Controller::join_links ($link, $extraArguments); + return $link; } /** diff --git a/templates/Includes/CMSMain_TreeView.ss b/templates/Includes/CMSMain_TreeView.ss index 9c54d888..141c5c46 100644 --- a/templates/Includes/CMSMain_TreeView.ss +++ b/templates/Includes/CMSMain_TreeView.ss @@ -22,7 +22,7 @@ $ExtraTreeTools <% end_if %> -
+
$SiteTreeAsUL
diff --git a/templates/Includes/CMSPagesController_ContentToolActions.ss b/templates/Includes/CMSPagesController_ContentToolActions.ss index 62052846..da3eba41 100644 --- a/templates/Includes/CMSPagesController_ContentToolActions.ss +++ b/templates/Includes/CMSPagesController_ContentToolActions.ss @@ -1,5 +1,5 @@