From 391e980d334f6220781be9449c80084f7ffe285e Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 14 Feb 2016 05:41:20 -0500 Subject: [PATCH] Add support for changes in friendsofcake/search This allows us to use the searchManager directly as opposed to the deprecated searchConfiguration method. --- src/Listener/ViewSearchListener.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Listener/ViewSearchListener.php b/src/Listener/ViewSearchListener.php index e2c010f4..a8609530 100644 --- a/src/Listener/ViewSearchListener.php +++ b/src/Listener/ViewSearchListener.php @@ -70,14 +70,16 @@ protected function _deriveFields() $table = $this->_table(); $request = $this->_request(); - if (!method_exists($table, 'searchConfiguration')) { - return []; + $filters = null; + if (method_exists($table, 'searchConfiguration')) { + $filters = $table->searchConfiguration(); + } else { + $filters = $table->searchManager(); } - $filters = $table->searchConfiguration(); + $fields = []; $schema = $table->schema(); - $fields = []; foreach ($filters->all() as $filter) { if ($filter->config('form') === false) { continue;