Uploaded files are not permanent, files get deleted on cron run

Created on 27 February 2021, about 4 years ago
Updated 6 June 2023, almost 2 years ago

When a file is uploaded using this drag&drop module, it is stored as a "Temporary" file, not "Permanent". So the file ends up being deleted by Drupal when temporary files are wiped on cron run.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States todea

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom aaron.ferris

    Had a quick look at this, does feel a bit odd but we should be able to set the file as permanent during the _webform_submit_component hook....

    I need to fully test this however, so consider this a first attempt.

  • Status changed to Needs review almost 2 years ago
  • πŸ‡¬πŸ‡§United Kingdom aaron.ferris

    Confirmed this seems to work correctly

    Before
    | fid | uid | filename | uri | filemime | filesize | status | timestamp |
    +-----+-----+-------------------+--------------------------------------+------------+----------+--------+------------+
    | 12 | 1 | awaitingimage.jpg | public://webform/awaitingimage.jpg | image/jpeg | 1241 | 0 | 1686064335 |
    | 13 | 1 | awaitingimage.jpg | public://webform/awaitingimage_0.jpg | image/jpeg | 1241 | 0 | 1686064456 |
    +-----+-----+-------------------+--------------------------------------+------------+----------+--------+------------+

    After
    +-----+-----+-------------------+--------------------------------------+------------+----------+--------+------------+
    | fid | uid | filename | uri | filemime | filesize | status | timestamp |
    +-----+-----+-------------------+--------------------------------------+------------+----------+--------+------------+
    | 12 | 1 | awaitingimage.jpg | public://webform/awaitingimage.jpg | image/jpeg | 1241 | 0 | 1686064335 |
    | 13 | 1 | awaitingimage.jpg | public://webform/awaitingimage_0.jpg | image/jpeg | 1241 | 1 | 1686064468 |
    +-----+-----+-------------------+--------------------------------------+------------+----------+--------+------------+

  • Status changed to Fixed almost 2 years ago
  • πŸ‡¬πŸ‡§United Kingdom aaron.ferris

    Thanks for the report, fixed and committed to 7.x-1.x

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024