Skip to content

Commit

Permalink
Planner: improve the improved default selected course in Unit Planner…
Browse files Browse the repository at this point in the history
… sidebar menu
  • Loading branch information
SKuipers committed Sep 5, 2024
1 parent 4d55430 commit 4b4adf3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions modules/Planner/moduleFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
4 changes: 2 additions & 2 deletions modules/Planner/units.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 4b4adf3

Please sign in to comment.