Piwik_ViewDataTable: $this->dataTable->getFirstRow() returns false and attempts to access getColumns() #820

anonymous-piwik-user opened this Issue Jun 21, 2009 · 1 comment

2 participants


If empty result set you cannot retrieve the columns, see modified code below

         * Returns columns names to display, in order.
         * If no columns were specified to be displayed, return all columns found in the first row.
         * @param array PHP array conversion of the data table
         * @return array
        public function getColumnsToDisplay()
                        $row = $this->dataTable->getFirstRow();
                        if (empty($row))
                                return array();

                        return array_keys($row->getColumns());
                $this->columnsToDisplay = array_filter($this->columnsToDisplay);
                return $this->columnsToDisplay;

(In [1245]) fixes #820

@anonymous-piwik-user anonymous-piwik-user added this to the Piwik 0.4.1 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment