Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUG: open ticket 7812 correcting filter syntax on a DataObject used b…

…y function updatetreenodes
  • Loading branch information...
commit 3e351bc421da1e317a0cff9c812209b294eee364 1 parent 0a6a3fa
@kmayo-ss kmayo-ss authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 admin/code/LeftAndMain.php
View
6 admin/code/LeftAndMain.php
@@ -753,9 +753,9 @@ public function updatetreenodes($request) {
$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 @@ function setIsCurrent($bool) {
return $this;
}
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.