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
This commit is contained in:
Jeremy Shipman 2007-09-19 01:24:43 +00:00 committed by Sam Minnee
parent 73b5103a78
commit 1726e9a65f
2 changed files with 6 additions and 3 deletions

View File

@ -599,8 +599,11 @@ JS;
$_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 File

@ -265,6 +265,6 @@ TreeContextMenu = {
treeNode.appendTreeNode(child);
}
treeNode.onOrderChanged(sortedChildren);
treeNode.onOrderChanged(sortedChildren,treeNode);
}
};