FriendsOfFlarum / upload

The file upload extension with insane intelligence for your Flarum forum.
https://discuss.flarum.org/d/4154
MIT License
176 stars 96 forks source link

`--cleanup` can not cleanup the file correctly #360

Open nibazshab opened 10 months ago

nibazshab commented 10 months ago

Bug Report

--cleanup work error php flarum fof:upload --map --cleanup can not cleanup the file correctly

Steps to Reproduce

  1. If I open a new post, and upload 2 file. then I got the file-link,and then close the post.
  2. Now I have two file not in any post.
  3. SELECT * FROM flarum_fof_upload_files;, I got 11 rows in set (0.000 sec)
  4. SELECT * FROM flarum_fof_upload_file_posts;, I got 9 rows in set (0.000 sec)
  5. use php flarum fof:upload --map --cleanup but 0 unused uploaded files cleaned up

Expected Behavior 2 file be deleted.

Environment

Flarum core: 1.8.3
PHP version: 8.0.30
MySQL version: 11.1.2-MariaDB-1:11.1.2+maria~ubu2204
Loaded extensions: Core, date, libxml, pcre, zlib, filter, hash, json, readline, Reflection, SPL, session, ctype, curl, dom, fileinfo, gd, gmp, iconv, intl, mbstring, openssl, PDO, standard, tokenizer, xmlwriter, zip, exif, mysqlnd, Phar, pdo_mysql, apcu, Zend OPcache
+--------------------------------+---------+--------+
| Flarum Extensions              |         |        |
+--------------------------------+---------+--------+
| ID                             | Version | Commit |
+--------------------------------+---------+--------+
| fof-upload                     | 1.4.6   |        |
| fof-links                      | 1.2.1   |        |
| flarum-tags                    | v1.8.0  |        |
| flarum-sticky                  | v1.8.0  |        |
| flarum-markdown                | v1.8.0  |        |
| flarum-lang-chinese-simplified | v1.3.0  |        |
| flarum-emoji                   | v1.8.0  |        |
| flarum-bbcode                  | v1.8.0  |        |
+--------------------------------+---------+--------+
Base URL: https://bbs.lblb.eu.org
Installation path: /flarum/app
Queue driver: sync
Session driver: file
Mail driver: smtp
Debug mode: off