From 788ffbb4175529c39c07a8bfe0a721453310f8ef Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Wed, 20 Apr 2016 05:29:24 +1000 Subject: [PATCH] Minor fix to custom list search scope --- modules/backend/widgets/Lists.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/backend/widgets/Lists.php b/modules/backend/widgets/Lists.php index 6103cb4ba..5743d50a7 100644 --- a/modules/backend/widgets/Lists.php +++ b/modules/backend/widgets/Lists.php @@ -1073,7 +1073,10 @@ class Lists extends WidgetBase $term = $this->searchTerm; if ($scopeMethod = $this->searchScope) { - $query->$scopeMethod($term); + $searchMethod = $boolean == 'and' ? 'where' : 'orWhere'; + $query->$searchMethod(function($q) use ($term, $scopeMethod) { + $q->$scopeMethod($term); + }); } else { $searchMethod = $boolean == 'and' ? 'searchWhere' : 'orSearchWhere';