Don't handle the case $this->searchColumns === null for actions in which ::setSearchColumns() is called

refs #8241
This commit is contained in:
Alexander A. Klimov 2015-05-19 15:26:21 +02:00
parent a2b262eab1
commit 3243f9a65a
1 changed files with 1 additions and 23 deletions

View File

@ -217,29 +217,7 @@ class FilterEditor extends AbstractWidget
if ($search !== null) {
if ($this->searchColumns === null) {
if (strpos($search, '=') === false) {
// TODO: Ask the view for (multiple) search columns
switch($request->getActionName()) {
case 'services':
$searchCol = 'service';
break;
case 'hosts':
$searchCol = 'host';
break;
case 'hostgroups':
$searchCol = 'hostgroup';
break;
case 'servicegroups':
$searchCol = 'servicegroup';
break;
default:
$searchCol = null;
}
if ($searchCol === null) {
throw new Exception('Cannot search here');
}
$search = ltrim($search);
$filter = $this->mergeRootExpression($filter, $searchCol, '=', "*$search*");
throw new Exception('Cannot search here');
} else {
list($k, $v) = preg_split('/=/', $search);
$filter = $this->mergeRootExpression($filter, trim($k), '=', ltrim($v));