MDL-82809 reportbuilder: always apply conditions to custom report.

Including those that are otherwise unavailable to the current user,
ensuring that they are always applied when viewing report output.
This commit is contained in:
Paul Holden
2024-10-16 10:51:36 +01:00
parent 9e5f911411
commit 26bb378e88
5 changed files with 51 additions and 9 deletions
@@ -79,7 +79,7 @@ abstract class base_report_table extends table_sql implements dynamic, renderabl
// For each condition, we need to ensure their values are always accounted for in the report.
$conditionvalues = $this->report->get_condition_values();
foreach ($this->report->get_active_conditions() as $condition) {
foreach ($this->report->get_active_conditions(false) as $condition) {
[$conditionsql, $conditionparams] = $this->get_filter_sql($condition, $conditionvalues, 'c' . $conditionindex++);
if ($conditionsql !== '') {
$joins = array_merge($joins, $condition->get_joins());