From 3e97c3ee83b673ec6008540c34d3dac71fa61726 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Mon, 12 Sep 2022 11:33:07 +0100 Subject: [PATCH] MDL-75721 reportbuilder: select from main table in absence of columns. Ensure any joins added to the report itself are also present. --- reportbuilder/classes/table/custom_report_table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reportbuilder/classes/table/custom_report_table.php b/reportbuilder/classes/table/custom_report_table.php index d393460f5bb..751fa0278df 100644 --- a/reportbuilder/classes/table/custom_report_table.php +++ b/reportbuilder/classes/table/custom_report_table.php @@ -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; }