DataFilter: json_en/decode when passing to form
This commit is contained in:
parent
9d8cc13dca
commit
24478ede12
|
@ -154,7 +154,9 @@ class Zend_View_Helper_FormDataFilter extends Zend_View_Helper_FormElement
|
|||
if ($filter) {
|
||||
// TODO: Make this configurable
|
||||
$type = 'host';
|
||||
$filter = clone($filter);
|
||||
|
||||
$filter->setExpression(json_decode($filter->getExpression()));
|
||||
$dummy = IcingaObject::createByType($type);
|
||||
$col = $filter->getColumn();
|
||||
if ($dummy->hasProperty($col)) {
|
||||
|
|
|
@ -231,7 +231,7 @@ class DataFilter extends FormElement
|
|||
return Filter::expression(
|
||||
$entry['column'],
|
||||
'=',
|
||||
true
|
||||
json_encode(true)
|
||||
);
|
||||
} elseif ($entry['sign'] === 'in') {
|
||||
if (array_key_exists('value', $entry)) {
|
||||
|
@ -248,13 +248,15 @@ class DataFilter extends FormElement
|
|||
return Filter::expression(
|
||||
$entry['column'],
|
||||
'=',
|
||||
$value
|
||||
json_encode($value)
|
||||
);
|
||||
} else {
|
||||
$value = array_key_exists('value', $entry) ? $entry['value'] : null;
|
||||
|
||||
return Filter::expression(
|
||||
$entry['column'],
|
||||
$entry['sign'],
|
||||
array_key_exists('value', $entry) ? $entry['value'] : null
|
||||
json_encode($value)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue