mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
MDL-80735 reportbuilder: do not render filters form during download
this removes unnecessary calculations and also prevents the session mutation
This commit is contained in:
parent
3fc907e3d8
commit
80ab39edcc
2 changed files with 4 additions and 3 deletions
|
@ -153,7 +153,7 @@ class custom_report_exporter extends persistent_exporter {
|
|||
|
||||
// Generate filters form if report contains any filters.
|
||||
$filterspresent = !empty($report->get_active_filters());
|
||||
if ($filterspresent) {
|
||||
if ($filterspresent && empty($this->download)) {
|
||||
$filtersform = $this->generate_filters_form()->render();
|
||||
}
|
||||
|
||||
|
|
|
@ -104,12 +104,13 @@ class system_report_exporter extends persistent_exporter {
|
|||
$filterset->add_filter(new integer_filter('reportid', null, [$reportid]));
|
||||
$filterset->add_filter(new string_filter('parameters', null, [$parameters]));
|
||||
|
||||
$table = system_report_table::create($reportid, (array) json_decode($parameters, true));
|
||||
$params = (array) json_decode($parameters, true);
|
||||
$table = system_report_table::create($reportid, $params);
|
||||
$table->set_filterset($filterset);
|
||||
|
||||
// Generate filters form if report uses the default form, and contains any filters.
|
||||
$filterspresent = $source->get_filter_form_default() && !empty($source->get_active_filters());
|
||||
if ($filterspresent) {
|
||||
if ($filterspresent && empty($params['download'])) {
|
||||
$filtersform = new filter(null, null, 'post', '', [], true, [
|
||||
'reportid' => $reportid,
|
||||
'parameters' => $parameters,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue