Fix FilePond: maxFileSize as bytes + temp files survive page reload

1. maxFileSize bug: FileValidateSize plugin overrides core's maxFileSize
   setter. Core uses toBytes('1GB') = 1073741824, but plugin registers
   maxFileSize as [null, Type.INT] which calls toInt('1GB') = 1.
   Fix: all maxFileSize and perExtensionMaxSize values as raw bytes.
   Also fix option name: fileValidateSizeFilterItem → fileValidateSizeFilter.

2. Temp file persistence: files uploaded via FilePond went to
   tmp/filepond/ and vanished from the UI on page reload because
   data-existing-files only included DB-persisted files.
   Fix: session-track temp file_ids in handleProcess, inject via
   getSessionTempFiles() into data-existing-files, teach handleLoad
   to stream temp files from disk, and route JS remove → revert for hex IDs.
This commit is contained in:
Pontoporeia
2026-06-09 17:41:31 +02:00
parent c4a550f9d1
commit 1490c99268
6 changed files with 234 additions and 26 deletions

View File

@@ -45,6 +45,14 @@ if ($thesisId) {
],
];
}
// Include session temp files so uploads survive page reload
require_once APP_ROOT . '/src/FilepondHandler.php';
$tempFiles = FilepondHandler::getSessionTempFiles($queueType);
foreach ($tempFiles as $tf) {
$result[] = $tf;
}
return $result;
};