fix: prevent file deletion on relink + restore button now visible + OOB-style in-place update

Two critical fixes:

1. Relink flow no longer destroys/recreates FilePond instances:
   The relink (XamxamRelinkFile) and PeerTube relink (XamxamRelinkPeerTube)
   previously refreshed the entire fichiers fragment via HTMX after
   pond.addFile(). This triggered destroyFilePondsIn on ALL pools, which
   could fire server.remove callbacks and move existing files to corbeille.
   Now just closes the modal — the file is already added to the pool in-place,
   and syncOrderInput creates the hidden form input.

2. Cleanup page « Corbeille (restaurable) » now actually shows files:
   _cleanup-stats-data.php previously classified trash files by checking if
   the thesis_files DB row still existed. But both deleteThesisFileToTrash
   and FilepondHandler::handleRemove DELETE the DB row. So ALL trash files
   appeared as `stale` (not restorable). Now uses the JSON sidecar file
   presence as the classification criterion — if the sidecar exists and is
   recent, the file is restorable regardless of DB row state.

Also removed unused DB query from _cleanup-stats-data.php.
This commit is contained in:
Pontoporeia
2026-07-10 16:29:04 +02:00
parent ed19e30cf0
commit 3cecee10c9
12 changed files with 587 additions and 73 deletions
+6
View File
@@ -7,3 +7,9 @@
- [x] Fix PeerTube upload failure: PHP /tmp tmpfs too small for large video files
- [x] Fix keyword word-breaking in repertoire.php: widen kw grid column, add white-space: nowrap
- [x] Fix licence.php TOC: restore `open` attribute on `<details class="toc">` (lost in vrxsstns, never restored by uuomvtvm fix)
- [x] Fix hasFilePondQueueData() missing peertube: prefix check → new PeerTube uploads silently lost on edit
- [x] Fix handleWebsiteUrl() in ThesisEditController unconditionally deleting website rows on every edit
- [x] Fix FilePond server.remove potentially triggering during HTMX fragment teardown
- [x] Add restore-from-corbeille functionality in cleanup page
- [x] Fix cleanup stats: use sidecar JSON for restorability classification (not DB row existence)
- [x] Remove destructive HTMX fragment refresh from relink flow (close modal only, pond.addFile in-place)