Skip to content
This repository
Browse code

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 authored August 27, 2012

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  admin/code/LeftAndMain.php
6  admin/code/LeftAndMain.php
@@ -753,9 +753,9 @@ public function updatetreenodes($request) {
753 753
 			$next = $prev = null;
754 754
 
755 755
 			$className = $this->stat('tree_class');
756  
-			$next = DataObject::get($className, 'ParentID = '.$record->ParentID.' AND Sort > '.$record->Sort)->first();
  756
+			$next = DataObject::get($className)->filter('ParentID', $record->ParentID)->filter('Sort:GreaterThan', $record->Sort)->first();
757 757
 			if (!$next) {
758  
-				$prev = DataObject::get($className, 'ParentID = '.$record->ParentID.' AND Sort < '.$record->Sort)->reverse()->first();
  758
+				$prev = DataObject::get($className)->filter('ParentID', $record->ParentID)->filter('Sort:LessThan', $record->Sort)->reverse()->first();
759 759
 			}
760 760
 
761 761
 			$link = Controller::join_links($recordController->Link("show"), $record->ID);
@@ -1615,4 +1615,4 @@ function setIsCurrent($bool) {
1615 1615
 		return $this;
1616 1616
 	}
1617 1617
 
1618  
-}
  1618
+}

0 notes on commit 3e351bc

Please sign in to comment.
Something went wrong with that request. Please try again.