mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Fixing additional cases where DataList needs to be returned correctly when filtering
This commit is contained in:
parent
d014b4d106
commit
b04c199064
@ -179,7 +179,7 @@ class GridFieldAddExistingAutocompleter implements GridField_HTMLProvider, GridF
|
|||||||
$stmts[] .= sprintf('"%s" LIKE \'%s%%\'', $searchField, $request->param('ID'));
|
$stmts[] .= sprintf('"%s" LIKE \'%s%%\'', $searchField, $request->param('ID'));
|
||||||
}
|
}
|
||||||
$results = $allList->where(implode(' OR ', $stmts))->subtract($gridField->getList());
|
$results = $allList->where(implode(' OR ', $stmts))->subtract($gridField->getList());
|
||||||
$results->sort($searchFields[0], 'ASC');
|
$results = $results->sort($searchFields[0], 'ASC');
|
||||||
|
|
||||||
$json = array();
|
$json = array();
|
||||||
foreach($results as $result) {
|
foreach($results as $result) {
|
||||||
|
@ -17,7 +17,7 @@ class GridFieldExportButtonTest extends SapphireTest {
|
|||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
$this->list = new DataList('GridFieldExportButtonTest_Team');
|
$this->list = new DataList('GridFieldExportButtonTest_Team');
|
||||||
$this->list->sort('Name');
|
$this->list = $this->list->sort('Name');
|
||||||
$config = GridFieldConfig::create()->addComponent(new GridFieldExportButton());
|
$config = GridFieldConfig::create()->addComponent(new GridFieldExportButton());
|
||||||
$this->gridField = new GridField('testfield', 'testfield', $this->list, $config);
|
$this->gridField = new GridField('testfield', 'testfield', $this->list, $config);
|
||||||
}
|
}
|
||||||
|
@ -58,8 +58,7 @@ class SS_MapTest extends SapphireTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function testKeys() {
|
function testKeys() {
|
||||||
$list = DataObjectTest_TeamComment::get();
|
$list = DataObjectTest_TeamComment::get()->sort('Name');
|
||||||
$list->sort('Name');
|
|
||||||
$map = new SS_Map($list, 'Name', 'Comment');
|
$map = new SS_Map($list, 'Name', 'Comment');
|
||||||
$this->assertEquals(array(
|
$this->assertEquals(array(
|
||||||
'Bob',
|
'Bob',
|
||||||
@ -69,8 +68,7 @@ class SS_MapTest extends SapphireTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function testMethodAsValueField() {
|
function testMethodAsValueField() {
|
||||||
$list = DataObjectTest_Team::get();
|
$list = DataObjectTest_Team::get()->sort('Title');
|
||||||
$list->sort('Title');
|
|
||||||
$map = new SS_Map($list, 'ID', 'MyTitle');
|
$map = new SS_Map($list, 'ID', 'MyTitle');
|
||||||
$this->assertEquals(array(
|
$this->assertEquals(array(
|
||||||
'Team Subteam 1',
|
'Team Subteam 1',
|
||||||
@ -83,8 +81,7 @@ class SS_MapTest extends SapphireTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function testValues() {
|
function testValues() {
|
||||||
$list = DataObjectTest_TeamComment::get();
|
$list = DataObjectTest_TeamComment::get()->sort('Name');
|
||||||
$list->sort('Name');
|
|
||||||
$map = new SS_Map($list, 'Name', 'Comment');
|
$map = new SS_Map($list, 'Name', 'Comment');
|
||||||
$this->assertEquals(array(
|
$this->assertEquals(array(
|
||||||
'This is a team comment by Bob',
|
'This is a team comment by Bob',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user