Problem/Motivation
When adding the reuse: true to the processing definition in a migration, the process plugin checks should check if a potentially reused file is currently marked as temporary in the database - if so it should be marked as permanent. This is already implemented, but the if-statement is wrong:
if (!$file->isTemporary()) {
$file->setPermanent();
$file->save();
}
This says: If the file for reuse is NOT temporary, mark it as permanent, which is useless ;)
To get this really working, this has to be switched to (no "!" before $file->isTemporary()):
if ($file->isTemporary()) {
$file->setPermanent();
$file->save();
}
Proposed resolution
- Fix the if-statement, so temporary files are marked as permanent
Remaining tasks
User interface changes
n/a
API changes
n/a
Data model changes
n/a
Release notes snippet
Fix temporary files are not marked as permanent when reused
Comments
Comment #2
hctom...and here is the proposed patch fixing this issue
Comment #3
nuuou commentedPatch applies cleanly for me, and does exactly what it says. Saved me the headache of "oh no where'd my files go". Thanks!
Comment #5
drclaw commentedThanks for the report! Silly mistake on my part. Not sure how this went unreported for so long though...
Committed to dev for now, new release soon!