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.
* <a class='mention' href='https://github.com/param'>@param</a> array PHP array conversion of the data table
* <a class='mention' href='https://github.com/return'>@return</a> array
*/
public function getColumnsToDisplay()
{
if(empty($this->columnsToDisplay))
{
$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