From 3959dc27d7128140150e8212c8d6785da9e7872c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 29 May 2015 11:36:08 +0200 Subject: [PATCH] Repository: Do not return filter columns when requiring all query columns I really wonder why I did not notice this until now... refs #8826 --- library/Icinga/Repository/Repository.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Repository/Repository.php b/library/Icinga/Repository/Repository.php index 7568a17f6..d615fd149 100644 --- a/library/Icinga/Repository/Repository.php +++ b/library/Icinga/Repository/Repository.php @@ -653,7 +653,15 @@ abstract class Repository implements Selectable throw new ProgrammingError('Table name "%s" not found', $table); } - return $queryColumns[$table]; + $filterColumns = $this->getFilterColumns(); + $columns = array(); + foreach ($queryColumns[$table] as $alias => $column) { + if (! in_array(is_string($alias) ? $alias : $column, $filterColumns)) { + $columns[$alias] = $column; + } + } + + return $columns; } /**