From fd21699a59f2a19c977f324a0e77523031f9e2ea Mon Sep 17 00:00:00 2001 From: Sandra Kuipers Date: Wed, 22 Jan 2025 14:09:53 +0800 Subject: [PATCH] Activities: fixed activity missing from the timetable if it doesn't have a category --- CHANGELOG.txt | 3 ++- src/Domain/Activities/ActivityGateway.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4bc0306a00..d9617367e2 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -38,7 +38,8 @@ v29.0.00 Bug Fixes - Activity: fixed missing registration button for parents on View Activities page + Activities: fixed activity missing from the timetable if it doesn't have a category + Activities: fixed missing registration button for parents on View Activities page System Admin: fixed field validation for Student Default Email in Form Builder System Admin: fixed uniqueness check when editing a page in Form Builder diff --git a/src/Domain/Activities/ActivityGateway.php b/src/Domain/Activities/ActivityGateway.php index 4fa9c2811a..f3b3762017 100644 --- a/src/Domain/Activities/ActivityGateway.php +++ b/src/Domain/Activities/ActivityGateway.php @@ -190,7 +190,7 @@ public function selectActiveEnrolledActivities($gibbonSchoolYearID, $gibbonPerso 'gibbonActivity.gibbonActivityID', 'gibbonActivity.name', 'gibbonActivity.provider', 'gibbonPerson.gibbonPersonID', 'gibbonActivitySlot.timeStart', 'gibbonActivitySlot.timeEnd', 'gibbonActivitySlot.locationExternal', 'gibbonSpace.name as space', 'gibbonDaysOfWeek.name as dayOfWeek', ]) ->innerJoin('gibbonActivitySlot', 'gibbonActivitySlot.gibbonActivityID=gibbonActivity.gibbonActivityID') - ->innerJoin('gibbonActivityCategory', 'gibbonActivityCategory.gibbonActivityCategoryID=gibbonActivity.gibbonActivityCategoryID') + ->leftJoin('gibbonActivityCategory', 'gibbonActivityCategory.gibbonActivityCategoryID=gibbonActivity.gibbonActivityCategoryID') ->innerJoin('gibbonDaysOfWeek', 'gibbonActivitySlot.gibbonDaysOfWeekID=gibbonDaysOfWeek.gibbonDaysOfWeekID') ->innerJoin('gibbonActivityStudent', 'gibbonActivity.gibbonActivityID=gibbonActivityStudent.gibbonActivityID') ->innerJoin('gibbonPerson', "gibbonActivityStudent.gibbonPersonID=gibbonPerson.gibbonPersonID") @@ -206,7 +206,7 @@ public function selectActiveEnrolledActivities($gibbonSchoolYearID, $gibbonPerso ->where('gibbonActivityStudent.gibbonPersonID=:gibbonPersonID') ->bindValue('gibbonPersonID', $gibbonPersonID) ->bindValue('dateType', $dateType) - ->where('CURRENT_TIMESTAMP >= gibbonActivityCategory.accessEnrolmentDate'); + ->where('(gibbonActivityCategory.gibbonActivityCategoryID IS NULL OR CURRENT_TIMESTAMP >= gibbonActivityCategory.accessEnrolmentDate)'); if ($dateType == 'Term') { $query->cols(['gibbonSchoolYearTerm.firstDay as dateStart', 'gibbonSchoolYearTerm.lastDay as dateEnd'])