From 382f62579bcb5588ac25642478f84ae78012c2d6 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Wed, 28 Sep 2022 12:44:50 +0100 Subject: [PATCH] MDL-75845 reportbuilder: hide "value" field for "current" operator. When using the date filter with the "Current" operator, the "Value" field should not be present (because it has no meaning). This fixes a small regression from 131a9740. --- reportbuilder/classes/local/filters/date.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reportbuilder/classes/local/filters/date.php b/reportbuilder/classes/local/filters/date.php index cf316783b01..43696e0b691 100644 --- a/reportbuilder/classes/local/filters/date.php +++ b/reportbuilder/classes/local/filters/date.php @@ -118,7 +118,7 @@ class date extends base { $elements[] = $mform->createElement('text', "{$this->name}_value", $valuelabel, ['size' => 3]); $mform->setType("{$this->name}_value", PARAM_INT); $mform->setDefault("{$this->name}_value", 1); - $mform->hideIf("{$this->name}_value", "{$this->name}_operator", 'in', $typesnounit + [self::DATE_CURRENT]); + $mform->hideIf("{$this->name}_value", "{$this->name}_operator", 'in', array_merge($typesnounit, [self::DATE_CURRENT])); // Unit selector for last and next operators. $unitlabel = get_string('filterdurationunit', 'core_reportbuilder', $this->get_header()); -- 2.11.4.GIT