diff --git a/TODO.md b/TODO.md index 9c09de5..14b0bcf 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,6 @@ # TODO -> Last updated: 2026-06-11 +> Last updated: 2026-06-11 11:42 > Context: Form Accessibility & Resilience improvements for XAMXAM thesis submission platform ## In Progress @@ -9,14 +9,13 @@ - [ ] #aria-test-manual Test WCAG changes with VoiceOver and NVDA on full add/edit/partage form flows - [ ] #nojs-upload-test Test end-to-end: submit partage form with JS disabled, verify files arrive via `$_FILES` -- [ ] #filepond-preserve Preserve FilePond temp file IDs on partage validation redirect `(partage/index.php)` `(FilepondHandler.php)` - [ ] #two-phase-commit Add two-phase commit: INSERT thesis `status='draft'`, COMMIT, move files, UPDATE to `active` `(ThesisCreateController.php)` - [ ] #cleanup-drafts Add periodic cleanup job for orphaned drafts (`just cleanup-drafts`) - - [ ] #form-setup-helper Add `ThesisFormSetup` helper class to reduce bootstrap duplication across add/edit/partage `(partage/index.php)` `(admin/add.php)` `(admin/edit.php)` ## Completed +- [x] #filepond-preserve Preserve FilePond temp file IDs on partage validation redirect `(partage/index.php)` `(FilepondHandler.php)` ✓ - [x] #refactor-partage Extract partage form page chrome to `templates/partage/form-page.php` `(partage/index.php)` ✓ - [x] #htmx-migration HTMX v2 migration: OverType editors, autosave handler, backend `HX-Request` detection ✓ - [x] #filepond-crash FilePond crash on TFE upload forms: root cause fixed (`.filename` → `.name`), all crashes resolved ✓ diff --git a/app/public/partage/index.php b/app/public/partage/index.php index 524d948..1a4baa0 100644 --- a/app/public/partage/index.php +++ b/app/public/partage/index.php @@ -536,6 +536,9 @@ function handleShareLinkSubmission(string $slug): void unset($_SESSION[$shareCsrfKey]); unset($_SESSION['share_verified_' . $slug]); unset($_SESSION['share_active']); + unset($_SESSION['share_primed_files_' . $slug]); + // Clear FilePond temp file tracking — files have been moved to permanent storage + unset($_SESSION['filepond_tmp']); // Send confirmation e-mail - on delivery failure, redirect to retry page $emailError = null; diff --git a/app/templates/partials/form/form.php b/app/templates/partials/form/form.php index 5cda0ef..dcd51fe 100644 --- a/app/templates/partials/form/form.php +++ b/app/templates/partials/form/form.php @@ -373,10 +373,15 @@ if ($filesMode === 'add'): ?> $_POST['admin_mode'] = $adminMode ? '1' : '0'; $_POST['has_annexes'] = $formData['has_annexes'] ?? null; - $existingFilesJsonForCover = []; - $existingFilesJsonForNoteIntention = []; - $existingFilesJsonForTfe = []; - $existingFilesJsonForAnnexe = []; + // Preserve FilePond temp files across validation redirects. + // Session temp files (uploaded via FilePond before a validation error) + // survive in $_SESSION['filepond_tmp'] and are fed to FilePond via + // data-existing-files so the user does not have to re-upload. + require_once APP_ROOT . '/src/FilepondHandler.php'; + $existingFilesJsonForCover = FilepondHandler::getSessionTempFiles('cover'); + $existingFilesJsonForNoteIntention = FilepondHandler::getSessionTempFiles('note_intention'); + $existingFilesJsonForTfe = FilepondHandler::getSessionTempFiles('tfe'); + $existingFilesJsonForAnnexe = FilepondHandler::getSessionTempFiles('annexe'); include APP_ROOT . '/templates/partials/form/fichiers-fragment.php'; $_POST = $_savedPost;