This commit is contained in:
@@ -105,6 +105,7 @@ final class SchoolYearManagementService
|
||||
'updated_by' => $userId,
|
||||
]);
|
||||
$this->configurationModel->setConfigValueByKey('school_year', (string) $year['name']);
|
||||
$this->syncActiveYearSession((string) $year['name']);
|
||||
$this->log($id, $from, SchoolYearStatus::ACTIVE, 'activate', $userId);
|
||||
|
||||
$this->db->transComplete();
|
||||
@@ -310,4 +311,15 @@ final class SchoolYearManagementService
|
||||
|
||||
return is_string($first) && $first !== '' ? $first : $fallback;
|
||||
}
|
||||
|
||||
private function syncActiveYearSession(string $schoolYearName): void
|
||||
{
|
||||
if (session_status() !== PHP_SESSION_ACTIVE) {
|
||||
return;
|
||||
}
|
||||
|
||||
session()->set('school_year', $schoolYearName);
|
||||
session()->remove('selected_school_year_id');
|
||||
session()->remove('selected_school_year');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user