Permalink
Browse files

MINOR if the $fieldname to DOS->sort has a direction in it, split it …

…out, and pass it. (from r96482) (from r98140)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102612 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 864a15d commit 99be47c479245e80162bfdd99c435ebf803bee55 @chillu chillu committed Apr 13, 2010
Showing with 4 additions and 0 deletions.
  1. +4 −0 core/model/DataObjectSet.php
@@ -850,6 +850,10 @@ public function getChildrenAsUL($nestingLevels, $level = 0, $template = "<li id=
*/
public function sort($fieldname, $direction = "ASC") {
if($this->items) {
+ if (preg_match('/(.+?)(\s+?)(A|DE)SC$/', $fieldname, $matches)) {
+ $fieldname = $matches[1];
+ $direction = $matches[3].'SC';
+ }
column_sort($this->items, $fieldname, $direction, false);
}
}

0 comments on commit 99be47c

Please sign in to comment.