Loading
fix: #3625496 Allow re-attaching a draft's own previously uploaded files
valueCallback() rejects any submitted file ID that isn't still marked temporary. Any file attached to a saved submission - including a draft - is deliberately made permanent so cron's temporary-file cleanup won't delete it while the draft sits unfinished. Net effect: resuming a draft and saving again treats its own already-uploaded file as invalid, clears it, and forces a re-upload every time.
Also accept a permanent file when it's already attached (via file.usage) to the webform submission currently being edited. An arbitrary permanent fid belonging to a different submission is still rejected, so the original tampering protection holds.
Edited by Erin Ward