Merge pull request #742 from silverstripe-rebelalliance/7812

BUG: open ticket 7812 correcting filter syntax on a DataObject used by f...
This commit is contained in:
Sam Minnée 2012-08-27 21:05:09 -07:00
commit 5b58e7951c

View File

@ -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;
}
}
}