remove the school reference
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 47s
Tests / PHPUnit (push) Successful in 1m22s

This commit is contained in:
root
2026-08-30 22:04:31 -04:00
parent 8d83cf84ab
commit 849a4579e9
5 changed files with 66 additions and 153 deletions
+2 -14
View File
@@ -2140,21 +2140,9 @@ class ParentController extends BaseController
// Loop through students
foreach ($incomingFirstNames as $idx => $firstName) {
if (!empty($firstName)) {
// ✅ 7. Extract is_new flag (convert to boolean)
$lastYearKey = 'last_year_' . $idx;
$lastYearVal = strtolower(trim($post[$lastYearKey] ?? ''));
$isNew = match ($lastYearVal) {
'yes' => false, // was with us last year => not new
'no' => true, // was not with us => new student
default => null // missing or invalid
};
if (!isset($isNew)) {
return redirect()->back()->withInput()->with('error', "Please select if student #" . ($idx + 1) . " was with us last year.");
}
// ✅ 8. Pass $isNew to the student save function
$lastYearVal = strtolower(trim($post[$lastYearKey] ?? 'no'));
$isNew = $lastYearVal !== 'yes';
$result = $this->validateAndSaveOrUpdateStudent($idx, $parentId, $this->semester, $this->schoolYear, $schoolIdService, $isNew, null);
if ($result) {