fix: scoped HTMX file validation, add validation to TFE/PeerTube inputs

- Wrap file-field.php validation in <form> to scope hx-include (fixes
  cross-field contamination where cover change triggered note_intention
  validation)
- Add inline MIME/size validation to upload-tfe-file.php
- Add inline validation to PeerTube video/audio and direct video/audio
  file inputs in format-extras-block
- Fallback in validate-file-fragment-shared.php: if field_name doesn't
  match any $_FILES key, try the first uploaded file (handles
  PeerTube inputs where name differs from field_name)
- Fix file-field.php admin_mode using $adminMode variable instead of
  undefined ADMIN_MODE constant
This commit is contained in:
Pontoporeia
2026-05-10 16:32:43 +02:00
parent ca7707cd47
commit 98ed83fac2
3 changed files with 28 additions and 20 deletions

19
TODO.md
View File

@@ -1,16 +1,7 @@
# TODO
- [x] Simplify file-upload-queue.js — drop Sortable, keep only single-file previews
- [x] Create session-based upload flow (upload-tfe-file.php, remove-tfe-file.php, tfe-queue-helper.php)
- [x] Create admin wrappers for upload/remove endpoints
- [x] Register new routes in partage/index.php
- [x] Update fichiers-fragment.php — HTMX-powered file input + server-rendered queue + progress bar
- [x] Update ThesisCreateController — read TFE files from session temp
- [x] Update ThesisEditController — read TFE files from session temp
- [x] Add handleTfeFilesFromSession + writeTfeFileFromSrc + cleanupSessionUploads to ThesisFileHandler trait
- [x] Remove sortable.min.js script tags from add.php, edit.php, index.php
- [x] Clean up form.php — remove drag handles, sortable hints
- [x] Clean up fieldset-files.php — remove sortable references
- [x] Clean up CSS — remove .fq-drag-handle, .fq-ghost, .sortable-ghost
- [x] Fix closure syntax (use before return type) in tfe-queue-helper.php
- [x] Commit
- [x] Fix cross-field validation contamination — wrap file-field.php in <form> to scope hx-include
- [x] Add inline MIME/size validation to upload-tfe-file.php
- [x] Add inline validation wrappers to PeerTube video/audio and direct video/audio inputs
- [x] Fix validator fallback: if field_name key missing in $_FILES, try first available file
- [x] Fix file-field.php admin_mode using $adminMode variable instead of undefined ADMIN_MODE constant