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
This commit is contained in:
Ingo Schommer 2010-04-13 02:17:25 +00:00
parent 864a15db8e
commit 99be47c479

View File

@ -850,6 +850,10 @@ class DataObjectSet extends ViewableData implements IteratorAggregate, Countable
*/
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);
}
}