Skip to content

Commit

Permalink
Add support for changes in friendsofcake/search
Browse files Browse the repository at this point in the history
This allows us to use the searchManager directly as opposed to the deprecated searchConfiguration method.
  • Loading branch information
josegonzalez committed Feb 14, 2016
1 parent 0818f1c commit 391e980
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Listener/ViewSearchListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 391e980

Please sign in to comment.