Permalink
Browse files

MINOR Fixing additional cases where DataList needs to be returned cor…

…rectly when filtering
  • Loading branch information...
1 parent d014b4d commit b04c199064a2ee4776ae9e954fec4881b6680a1c @halkyon halkyon committed Jun 15, 2012
@@ -179,8 +179,8 @@ public function doSearch($gridField, $request) {
$stmts[] .= sprintf('"%s" LIKE \'%s%%\'', $searchField, $request->param('ID'));
}
$results = $allList->where(implode(' OR ', $stmts))->subtract($gridField->getList());
- $results->sort($searchFields[0], 'ASC');
-
+ $results = $results->sort($searchFields[0], 'ASC');
+
$json = array();
foreach($results as $result) {
$json[$result->ID] = SSViewer::fromString($this->resultsFormat)->process($result);
@@ -17,7 +17,7 @@ public function setUp() {
parent::setUp();
$this->list = new DataList('GridFieldExportButtonTest_Team');
- $this->list->sort('Name');
+ $this->list = $this->list->sort('Name');
$config = GridFieldConfig::create()->addComponent(new GridFieldExportButton());
$this->gridField = new GridField('testfield', 'testfield', $this->list, $config);
}
View
@@ -58,8 +58,7 @@ function testToArray() {
}
function testKeys() {
- $list = DataObjectTest_TeamComment::get();
- $list->sort('Name');
+ $list = DataObjectTest_TeamComment::get()->sort('Name');
$map = new SS_Map($list, 'Name', 'Comment');
$this->assertEquals(array(
'Bob',
@@ -69,8 +68,7 @@ function testKeys() {
}
function testMethodAsValueField() {
- $list = DataObjectTest_Team::get();
- $list->sort('Title');
+ $list = DataObjectTest_Team::get()->sort('Title');
$map = new SS_Map($list, 'ID', 'MyTitle');
$this->assertEquals(array(
'Team Subteam 1',
@@ -83,8 +81,7 @@ function testMethodAsValueField() {
}
function testValues() {
- $list = DataObjectTest_TeamComment::get();
- $list->sort('Name');
+ $list = DataObjectTest_TeamComment::get()->sort('Name');
$map = new SS_Map($list, 'Name', 'Comment');
$this->assertEquals(array(
'This is a team comment by Bob',

0 comments on commit b04c199

Please sign in to comment.