diff --git a/library/Icingadb/Web/Controller.php b/library/Icingadb/Web/Controller.php index 49bd1c799..c8765ef7d 100644 --- a/library/Icingadb/Web/Controller.php +++ b/library/Icingadb/Web/Controller.php @@ -87,12 +87,13 @@ public function createColumnControl(Query $query, ViewModeSwitcher $viewModeSwit { // All of that is essentially what `ColumnControl::apply()` should do $viewMode = $this->getRequest()->getUrl()->getParam($viewModeSwitcher->getViewModeParam()); - $columnsDef = $this->params->shift('columns'); - if (! $columnsDef) { - if ($viewMode === 'tabular') { - $this->httpBadRequest('Missing parameter "columns"'); - } + if ($viewMode === 'tabular' && ! $this->params->has('columns')) { + $this->httpBadRequest('Missing parameter "columns"'); + } + + $columnsDef = $this->params->shift('columns'); + if (empty($columnsDef) || $columnsDef === '1') { return []; }