fix family card issue
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 48s
Tests / PHPUnit (push) Failing after 1m27s

This commit is contained in:
root
2026-09-12 03:16:10 -04:00
parent ce504c933e
commit 1787144f27
11 changed files with 382 additions and 11 deletions
+14 -2
View File
@@ -356,8 +356,20 @@ html, body { overflow-x: hidden; }
try {
const gid = params && params.guardian_id;
const sid = params && params.student_id;
if (gid) window.location.href = '<?= site_url('family') ?>' + '?guardian_id=' + encodeURIComponent(gid);
else if (sid) window.location.href = '<?= site_url('family') ?>' + '?student_id=' + encodeURIComponent(sid);
const familyUrl = new URL('<?= site_url('family') ?>', window.location.origin);
const currentPath = window.location.pathname.replace(/\/+$/, '');
const familyPath = familyUrl.pathname.replace(/\/+$/, '');
const familyIndexPath = familyPath + '/index';
if (currentPath !== familyPath && currentPath !== familyIndexPath && (gid || sid)) {
familyUrl.searchParams.set(gid ? 'guardian_id' : 'student_id', gid || sid);
window.location.href = familyUrl.toString();
return;
}
const target = document.getElementById('familyCardContent');
if (target) target.innerHTML = '<div class="p-3 text-danger">The family card could not be loaded. Please refresh and try again.</div>';
const m = ensureModal();
if (m) m.show();
} catch(_) {}
}
}