From 3e351bc421da1e317a0cff9c812209b294eee364 Mon Sep 17 00:00:00 2001 From: Kirk Mayo Date: Mon, 27 Aug 2012 14:41:07 +1200 Subject: [PATCH] BUG: open ticket 7812 correcting filter syntax on a DataObject used by function updatetreenodes --- admin/code/LeftAndMain.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index e789450cc..622a69b16 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -753,9 +753,9 @@ class LeftAndMain extends Controller implements PermissionProvider { $next = $prev = null; $className = $this->stat('tree_class'); - $next = DataObject::get($className, 'ParentID = '.$record->ParentID.' AND Sort > '.$record->Sort)->first(); + $next = DataObject::get($className)->filter('ParentID', $record->ParentID)->filter('Sort:GreaterThan', $record->Sort)->first(); if (!$next) { - $prev = DataObject::get($className, 'ParentID = '.$record->ParentID.' AND Sort < '.$record->Sort)->reverse()->first(); + $prev = DataObject::get($className)->filter('ParentID', $record->ParentID)->filter('Sort:LessThan', $record->Sort)->reverse()->first(); } $link = Controller::join_links($recordController->Link("show"), $record->ID); @@ -1615,4 +1615,4 @@ class LeftAndMain_TreeNode extends ViewableData { return $this; } -} \ No newline at end of file +}