From d76ae00275a9f8eff6027b760aa149fe6130aa24 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 8 Nov 2019 17:43:19 +0100 Subject: [statistics] Fix filtering by prefixing columns with table name --- modules-available/statistics/inc/statisticsfilter.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules-available/statistics/inc/statisticsfilter.inc.php b/modules-available/statistics/inc/statisticsfilter.inc.php index 1556a1e0..934e01da 100644 --- a/modules-available/statistics/inc/statisticsfilter.inc.php +++ b/modules-available/statistics/inc/statisticsfilter.inc.php @@ -76,7 +76,7 @@ class StatisticsFilter $op = 'NOT LIKE'; } - return $this->column . ' ' . $op . ' :' . $key . $addendum; + return 'm.' . $this->column . ' ' . $op . ' :' . $key . $addendum; } /* parse a query into an array of filters */ @@ -440,7 +440,7 @@ class StateStatisticsFilter extends StatisticsFilter if (array_key_exists($this->argument, $map)) { $key = StatisticsFilter::getNewKey($this->column); $args[$key] = $map[$this->argument]; - return " machine.state $neg IN ( :$key ) "; + return " m.state $neg IN ( :$key ) "; } else { Message::addError('invalid-filter-argument', 'state', $this->argument); return ' 1'; @@ -468,7 +468,7 @@ class LocationStatisticsFilter extends StatisticsFilter } $neg = $this->operator === '=' ? '' : 'NOT'; if ($this->argument === 0) { - return "machine.locationid IS $neg NULL"; + return "m.locationid IS $neg NULL"; } else { $key = StatisticsFilter::getNewKey($this->column); if ($recursive) { @@ -476,7 +476,7 @@ class LocationStatisticsFilter extends StatisticsFilter } else { $args[$key] = $this->argument; } - return "machine.locationid $neg IN (:$key)"; + return "m.locationid $neg IN (:$key)"; } } } -- cgit v1.2.3-55-g7522