Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed CMS sort sub-pages bug

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.1.0@42287 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 1726e9a65ff169bca2e10bde17938a118cfe263e 1 parent 73b5103
Jeremy Shipman authored sminnee committed
Showing with 6 additions and 3 deletions.
  1. +5 −2 code/LeftAndMain.php
  2. +1 −1  javascript/CMSMain_left.js
View
7 code/LeftAndMain.php
@@ -599,8 +599,11 @@ public function ajaxupdatesort() {
$_REQUEST['ajax'] = 1;
if(is_array($_REQUEST['ID'])) {
- $movedNode = DataObject::get_by_id($className, $_REQUEST['MovedNodeID']);
-
+ if($_REQUEST['MovedNodeID']==0){ //Sorting root
+ $movedNode = DataObject::get($className, "`ParentID`=0");
+ }else{
+ $movedNode = DataObject::get_by_id($className, $_REQUEST['MovedNodeID']);
+ }
foreach($_REQUEST['ID'] as $id) {
if($id == $movedNode->ID) {
$movedNode->Sort = ++$counter;
View
2  javascript/CMSMain_left.js
@@ -265,6 +265,6 @@ TreeContextMenu = {
treeNode.appendTreeNode(child);
}
- treeNode.onOrderChanged(sortedChildren);
+ treeNode.onOrderChanged(sortedChildren,treeNode);
}
};
Please sign in to comment.
Something went wrong with that request. Please try again.