From 5dc5e0b4c59c7654c2f4c6e0f74cea3f741459dc Mon Sep 17 00:00:00 2001 From: Simon Welsh Date: Fri, 5 Jul 2013 10:41:18 +1200 Subject: [PATCH 1/2] Quote table/column names when falling back to $fullName --- search/filters/SearchFilter.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/search/filters/SearchFilter.php b/search/filters/SearchFilter.php index c647a3eab..5df64815f 100644 --- a/search/filters/SearchFilter.php +++ b/search/filters/SearchFilter.php @@ -183,7 +183,8 @@ abstract class SearchFilter extends Object { if($candidateClass == 'DataObject') { // fallback to the provided name in the event of a joined column // name (as the candidate class doesn't check joined records) - return $this->fullName; + $parts = explode('.', $this->fullName); + return '"' . implode('"."', $parts) . '"'; } return "\"$candidateClass\".\"$this->name\""; From ff45f7ce4d1b0176c303d8a6c8d3ef9e18570c90 Mon Sep 17 00:00:00 2001 From: Simon Welsh Date: Fri, 5 Jul 2013 11:45:34 +1200 Subject: [PATCH 2/2] DataListTest should not rely on order of values when not explictly sorting --- tests/model/DataListTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/model/DataListTest.php b/tests/model/DataListTest.php index 456d48120..a96e2a6a8 100644 --- a/tests/model/DataListTest.php +++ b/tests/model/DataListTest.php @@ -625,7 +625,8 @@ class DataListTest extends SapphireTest { )); $this->assertEquals(2, $list->count()); - $this->assertEquals(array('Joe', 'Bob'), $list->column('Name')); + $values = $list->column('Name'); + $this->assertEquals(array_intersect($values, array('Joe', 'Bob')), $values); } public function testFilterAndExcludeById() {