fix parent and teacher pages to follow year filter
Tests / PHPUnit (push) Failing after 1m15s

This commit is contained in:
root
2026-07-15 20:03:36 -04:00
parent feb1b29a32
commit 5f27dccd0f
32 changed files with 582 additions and 364 deletions
+11 -7
View File
@@ -1065,13 +1065,7 @@ class GradingController extends Controller
public function belowSixty()
{
$configuredYear = (string) $this->schoolYear;
$schoolYear = trim((string)($this->request->getGet('school_year') ?? ''));
if ($schoolYear === '') {
$schoolYear = $configuredYear;
}
$schoolYear = $this->currentSchoolYearName((string) $this->schoolYear);
// This page is Fall only.
$semester = 'fall';
@@ -1124,6 +1118,16 @@ public function belowSixty()
'canViewGrading' => $canViewGrading,
]);
}
private function currentSchoolYearName(?string $fallback = null): string
{
try {
return service('schoolYearContext')->resolve($this->request)->yearName();
} catch (\Throwable) {
return trim((string) ($fallback ?? ''));
}
}
public function editBelowSixtyEmail()
{
$studentId = (int)$this->request->getGet('student_id');