Fix relink: close modal + HTMX refresh for immediate pool update

- After relink, always close the modal (even if FilePond input not found,
  e.g. page refreshed by live-reload during the fetch).
- After closing, re-fetch #format-fichiers-block via HTMX from
  /admin/fragments/fichiers.php?_thesis_id=N which loads thesis files
  from DB and re-renders the fragment with pre-populated FilePond pools.
  The afterSwap handler auto-reinitializes FilePond instances.
- Updated admin/fragments/fichiers.php to accept _thesis_id, load
  existing files from DB, build per-queue-type JSON, and render in
  edit mode.
This commit is contained in:
Pontoporeia
2026-05-19 01:13:39 +02:00
parent b77bc486e5
commit 7c30d1c55d
3 changed files with 74 additions and 8 deletions

View File

@@ -31,6 +31,8 @@
- [x] CSS: .relink-modal + .file-browser styles in form.css
- [x] Fix: relinked file not appearing in FilePond pool — add file metadata to addFile() options and extensive diag logging
- [x] Fix: addFile called with single object instead of (source, options) — FilePond API mismatch prevented files from loading
- [x] Fix: use type 'limbo' for relinked files so they go through DID_COMPLETE_ITEM_PROCESSING → onprocessfile → syncOrderInput + green checkmark visual
- [x] Fix: change .filepond--file default border from yellow to green (existing files never reach processing-complete state)
- [ ] Migration: rename existing theses/ directories to documents/ on disk and update DB paths
## Trash policy