Fix: email clearing in findOrCreateAuthor, htmlspecialchars(null) crash in old(), dead contact_interne field, access_type_id radio clearing

- findOrCreateAuthor: always update email column (pass null when empty/falsy) so clearing an email actually persists
- admin/add.php & admin/edit.php old(): add null guard before htmlspecialchars, cast to string
- jury-fieldset.php: guard against old() returning array for scalar-checked jury_lecteur keys
- formulaire.php: only suppress display_errors in production (not cli-server dev mode)
- Removed dead contact_interne field from backoffice form (no DB column, never saved)
- Removed dead contactInterne validation from ThesisCreateController
- Added "— Non défini" radio option for access_type_id in admin mode for clearing
- Fixed strict int-vs-string comparison breaking radio button checked detection
This commit is contained in:
Pontoporeia
2026-05-10 02:55:47 +02:00
parent 6cc0e407f3
commit 8a4b2541fb
10 changed files with 58 additions and 42 deletions

View File

@@ -507,15 +507,6 @@ class ThesisCreateController
}
}
// Contact interne (optional, admin-only)
$contactInterne = trim($post['contact_interne'] ?? '');
if ($contactInterne !== '') {
$contactInterne = filter_var($contactInterne, FILTER_VALIDATE_EMAIL);
if ($contactInterne === false) {
throw new Exception("L'adresse de contact interne n'est pas valide.");
}
}
// Note contextuelle (optional, max 1500 chars)
$contextNote = $this->sanitiseString($post['context_note'] ?? '');
if (strlen($contextNote) > 1500) {
@@ -539,7 +530,6 @@ class ThesisCreateController
'authorNames',
'mail',
'showContact',
'contactInterne',
'annee',
'orientationId',
'apProgramId',