From fc8b51c4be6b30755dbdc4393d8dac381cc683fc Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 7 Jul 2015 15:50:40 +0200 Subject: [PATCH] ObjectList: Register columns to select even if we're only counting We should never apply any pseudo optimizations on a higher level if already the lower level applies them, as the optimization might not be valid in every circumstance. fixes #9573 --- .../monitoring/library/Monitoring/Object/ObjectList.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Object/ObjectList.php b/modules/monitoring/library/Monitoring/Object/ObjectList.php index 669e8ff39..0b9575a22 100644 --- a/modules/monitoring/library/Monitoring/Object/ObjectList.php +++ b/modules/monitoring/library/Monitoring/Object/ObjectList.php @@ -124,9 +124,14 @@ abstract class ObjectList implements Countable, IteratorAggregate, Filterable public function count() { if ($this->count === null) { - $this->count = (int) $this->backend->select()->from($this->dataViewName)->applyFilter($this->filter) - ->getQuery()->count(); + $this->count = (int) $this->backend + ->select() + ->from($this->dataViewName, $this->columns) + ->applyFilter($this->filter) + ->getQuery() + ->count(); } + return $this->count; }