MDL-75721 reportbuilder: select from main table in absence of columns.

Ensure any joins added to the report itself are also present.
This commit is contained in:
Paul Holden
2022-09-15 17:07:20 +01:00
parent 844abeaf5d
commit 3e97c3ee83
@@ -81,7 +81,7 @@ class custom_report_table extends base_report_table {
// Retrieve all report columns, exit early if there are none.
$columns = $this->get_active_columns();
if (empty($columns)) {
$this->init_sql('*', "{{$maintable}} {$maintablealias}", [], '1=0', []);
$this->init_sql("{$maintablealias}.*", "{{$maintable}} {$maintablealias}", $joins, '1=0', []);
return;
}