Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

ManyMany Grid Field Search Case Sensitive

Go to End

2 Posts   1167 Views


Community Member, 244 Posts

12 June 2013 at 2:55pm


on our postres site, the manymany search is defaulting to case sensitive - making it pretty hard to field items.

I've found a way of editing 'GridFieldAddExistingAutocompleter' in the core files to fix this, but is there a away of using somthing like 'setSearchFields' to for case sensititive / case insensitive searches?



Administrator, 690 Posts

12 December 2013 at 1:41pm


This has been fixed in 3.1, but if you're using 3.0 you can do this quick patch. Note that this will break other databases, which is why we haven't committed it to 3.0.

--- a/forms/gridfield/GridFieldAddExistingAutocompleter.php
+++ b/forms/gridfield/GridFieldAddExistingAutocompleter.php
@@ -195,7 +195,7 @@ class GridFieldAddExistingAutocompleter
                // TODO Replace with DataList->filterAny() once it correctly supports OR connectives
                $stmts = array();
                foreach($searchFields as $searchField) {
-                       $stmts[] .= sprintf('"%s" LIKE \'%s%%\'', $searchField,
+                       $stmts[] .= sprintf('"%s" ILIKE \'%s%%\'', $searchField,
                $results = $allList->where(implode(' OR ', $stmts))->subtract($gridField->getList());