Skip to content

Commit

Permalink
Merge pull request #742 from silverstripe-rebelalliance/7812
Browse files Browse the repository at this point in the history
BUG: open ticket 7812 correcting filter syntax on a DataObject used by f...
  • Loading branch information
sminnee committed Aug 28, 2012
2 parents 881952b + 3e351bc commit 5b58e79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions admin/code/LeftAndMain.php
Expand Up @@ -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);
Expand Down Expand Up @@ -1615,4 +1615,4 @@ function setIsCurrent($bool) {
return $this;
}

}
}

0 comments on commit 5b58e79

Please sign in to comment.