Fixed CMS sort sub-pages bug

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42935 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-10-02 05:10:35 +00:00
parent e5060b6d30
commit f9b314d662
2 changed files with 6 additions and 3 deletions

View File

@ -657,8 +657,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

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