From 4b4adf357afac4534ecd34f5774a2c602aa7cb37 Mon Sep 17 00:00:00 2001 From: Sandra Kuipers Date: Thu, 5 Sep 2024 10:21:03 +0800 Subject: [PATCH] Planner: improve the improved default selected course in Unit Planner sidebar menu --- modules/Planner/moduleFunctions.php | 4 ++-- modules/Planner/units.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/Planner/moduleFunctions.php b/modules/Planner/moduleFunctions.php index a676062b28..7ad8a5baf9 100644 --- a/modules/Planner/moduleFunctions.php +++ b/modules/Planner/moduleFunctions.php @@ -407,8 +407,8 @@ function sidebarExtraUnits($guid, $connection2, $gibbonCourseID, $gibbonSchoolYe // Show class picker in sidebar $courseGateway = $container->get(CourseGateway::class); - if (!empty($_GET['gibbonCourseID'])) { - $session->set('gibbonCourseIDUnitPlanner', $_GET['gibbonCourseID']); + if (!empty($_GET['courseName'])) { + $session->set('courseNameUnitPlanner', $_GET['courseName']); } if ($highestAction == 'Unit Planner_all') { diff --git a/modules/Planner/units.php b/modules/Planner/units.php index 7db1c8ebeb..539dbd52d1 100644 --- a/modules/Planner/units.php +++ b/modules/Planner/units.php @@ -48,14 +48,14 @@ // School Year Info $gibbonSchoolYearID = $_GET['gibbonSchoolYearID'] ?? $session->get('gibbonSchoolYearID'); - $gibbonCourseID = $_GET['gibbonCourseID'] ?? $session->get('gibbonCourseIDUnitPlanner') ?? null; + $gibbonCourseID = $_GET['gibbonCourseID'] ?? null; if (empty($gibbonSchoolYearID)) { $page->addError(__('Your request failed because your inputs were invalid.')); return; } - $courseName = $_GET['courseName'] ?? ''; + $courseName = $_GET['courseName'] ?? $session->get('courseNameUnitPlanner') ?? ''; if (empty($gibbonCourseID) && !empty($courseName)) { $row = $container->get(CourseGateway::class)->selectBy(['gibbonSchoolYearID' => $gibbonSchoolYearID, 'nameShort' => $courseName])->fetch();