Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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 tractorcow authored
8 code/controllers/CMSMain.php
View
@@ -202,8 +202,12 @@ protected function LinkWithSearch($link) {
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;
}
/**
2  templates/Includes/CMSMain_TreeView.ss
View
@@ -22,7 +22,7 @@ $ExtraTreeTools
</div>
<% end_if %>
- <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">
+ <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">
$SiteTreeAsUL
</div>
</div>
2  templates/Includes/CMSPagesController_ContentToolActions.ss
View
@@ -1,5 +1,5 @@
<div class="cms-actions-row">
- <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>
+ <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>
</div>
<div class="cms-content-batchactions">
Please sign in to comment.
Something went wrong with that request. Please try again.