Skip to content
This repository
Browse code

FIXED: Additional issue where the add-page ajax parameters wouldu inc…

…orrectly concatenate additional query parameters into the add action url. Resolved by moving URL concatenation from view to controller where Controller::join_links is available
  • Loading branch information...
commit 7807842eb185f7c875a1957106f5764f32c2c487 1 parent a6087f1
Damian Mooyman authored August 21, 2012
8  code/controllers/CMSMain.php
@@ -202,8 +202,12 @@ protected function LinkWithSearch($link) {
202 202
 		return $link;
203 203
 	}
204 204
 
205  
-	function LinkPageAdd() {
206  
-		return singleton("CMSPageAddController")->Link();
  205
+	function LinkPageAdd($extraArguments = null) {
  206
+		$link = singleton("CMSPageAddController")->Link();
  207
+		$this->extend('updateLinkPageAdd', $link);
  208
+		if($extraArguments)
  209
+			$link = Controller::join_links ($link, $extraArguments);
  210
+		return $link;
207 211
 	}
208 212
 	
209 213
 	/**
2  templates/Includes/CMSMain_TreeView.ss
@@ -22,7 +22,7 @@ $ExtraTreeTools
22 22
 	</div>
23 23
 	<% end_if %>
24 24
 
25  
-	<div class="cms-tree" data-url-tree="$Link(getsubtree)" data-url-savetreenode="$Link(savetreenode)" data-url-updatetreenodes="$Link(updatetreenodes)" data-url-addpage="{$LinkPageAdd}AddForm/?action_doAdd=1&amp;ParentID=%s&amp;PageType=%s&amp;SecurityID=$SecurityID" data-url-editpage="$LinkPageEdit('%s')" data-hints="$SiteTreeHints">
  25
+	<div class="cms-tree" data-url-tree="$Link(getsubtree)" data-url-savetreenode="$Link(savetreenode)" data-url-updatetreenodes="$Link(updatetreenodes)" data-url-addpage="{$LinkPageAdd('AddForm/?action_doAdd=1')}&amp;ParentID=%s&amp;PageType=%s&amp;SecurityID=$SecurityID" data-url-editpage="$LinkPageEdit('%s')" data-hints="$SiteTreeHints">
26 26
 		$SiteTreeAsUL
27 27
 	</div>
28 28
 </div>
2  templates/Includes/CMSPagesController_ContentToolActions.ss
... ...
@@ -1,5 +1,5 @@
1 1
 <div class="cms-actions-row">
2  
-	<a class="cms-page-add-button ss-ui-button ss-ui-action-constructive" data-icon="add" href="$LinkPageAdd" data-url-addpage="{$LinkPageAdd}?ParentID=%s"><% _t('CMSMain.AddNewButton', 'Add new') %></a>
  2
+	<a class="cms-page-add-button ss-ui-button ss-ui-action-constructive" data-icon="add" href="$LinkPageAdd" data-url-addpage="{$LinkPageAdd('?ParentID=%s')}"><% _t('CMSMain.AddNewButton', 'Add new') %></a>
3 3
 </div>
4 4
 
5 5
 <div class="cms-content-batchactions">

0 notes on commit 7807842

Please sign in to comment.
Something went wrong with that request. Please try again.