diff --git a/lib/tablelib.php b/lib/tablelib.php index 8409b5972c8..33e268824c9 100644 --- a/lib/tablelib.php +++ b/lib/tablelib.php @@ -2048,6 +2048,8 @@ class table_sql extends flexible_table { } /** + * Build the table from the fetched data. + * * Take the data returned from the db_query and go through all the rows * processing each col using either col_{columnname} method or other_cols * method or if other_cols returns NULL then put the data straight into the @@ -2056,18 +2058,13 @@ class table_sql extends flexible_table { * After calling this function, don't forget to call close_recordset. */ public function build_table() { - - if ($this->rawdata instanceof \Traversable && !$this->rawdata->valid()) { - return; - } if (!$this->rawdata) { return; } foreach ($this->rawdata as $row) { $formattedrow = $this->format_row($row); - $this->add_data_keyed($formattedrow, - $this->get_row_class($row)); + $this->add_data_keyed($formattedrow, $this->get_row_class($row)); } }