Don't include time macros in field list (#10299)

They can only be used as the value
This commit is contained in:
Tony Murray
2019-06-03 22:34:34 -05:00
committed by GitHub
parent 16471931c0
commit cc0fa745b2

View File

@@ -65,6 +65,10 @@ class QueryBuilderFilter implements \JsonSerializable
foreach ($macros as $key => $value) {
$field = 'macros.' . $key;
if (preg_match('/^past_\d+m$/', $key)) {
continue; // don't include the time based macros, they don't work like that
}
if (ends_with($key, '_usage_perc')) {
$this->filter[$field] = [
'id' => $field,