From 2f91194d0609a6a25f6829d0b39beabbdb937d2d Mon Sep 17 00:00:00 2001 From: William Allen <16820599+williamjallen@users.noreply.github.com> Date: Wed, 15 Nov 2023 12:54:25 -0500 Subject: [PATCH] Fix date filter bug when subproject specified (#1797) The curly braces around the date filter for the index page were not properly placed, leading to the filter being disabled for most common cases. This bugfix will be backported to CDash 3.2. --- app/cdash/app/Controller/Api/Index.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/cdash/app/Controller/Api/Index.php b/app/cdash/app/Controller/Api/Index.php index 314ab7f40b..9b19557f91 100644 --- a/app/cdash/app/Controller/Api/Index.php +++ b/app/cdash/app/Controller/Api/Index.php @@ -159,13 +159,13 @@ public function getDailyBuilds(): array } elseif (!is_numeric($this->subProjectId)) { // Only show builds that are not children. $sql .= ' AND (b.parentid = -1 OR b.parentid = 0) '; + } - // If the filter data doesn't have a date clause, use this as a default - if (!$this->filterdata['hasdateclause']) { - $sql .= " AND b.starttime < ? AND b.starttime >= ? "; - $query_params[] = $this->endDate; - $query_params[] = $this->beginDate; - } + // If the filter data doesn't have a date clause, use this as a default + if (!$this->filterdata['hasdateclause']) { + $sql .= " AND b.starttime < ? AND b.starttime >= ? "; + $query_params[] = $this->endDate; + $query_params[] = $this->beginDate; } // Should we query by subproject?