Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…rectly when filtering
  • Loading branch information...
commit b04c199064a2ee4776ae9e954fec4881b6680a1c 1 parent d014b4d
@halkyon halkyon authored
View
4 forms/gridfield/GridFieldAddExistingAutocompleter.php
@@ -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);
View
2  tests/forms/gridfield/GridFieldExportButtonTest.php
@@ -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
9 tests/model/MapTest.php
@@ -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',
Please sign in to comment.
Something went wrong with that request. Please try again.