Review main Merged

82064[FEATURE] Allow record reset in CLI command cleanup:localprocessedfiles

Garvin Hicking CR +2 V +2 Normal +172 −29 updated 01/04/24, 14:12

Commit message

A new CLI Symfony Command option `--all` is added to the
CLI command `bin/typo3 cleanup:localprocessedfiles` that allows
to reset all entries in the database to force re-creating processed
files.

When developing FAL features or updating installations with large
user-generated content fileadmin storages, it may be helpful to
clean the sys_file_processedfile database table completely to
force a rebuild (i.e. when new FAL-Processors are added).

This table holds all locally generated processed files with
specific crop or size variants (or references to unaltered
originals, or "proxy" entries).

The new command option will also report the numbers of deleted records
before execution, and allows you to review execution. It is
not set by default.

Also, a small error in the output has been fixed that counted
the number of database records wrongly.

Tests were added for the new option.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Guido Schmechel +1
    • Anja Leichsenring +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Guido Schmechel +1
    • Anja Leichsenring +1
    • core-ci +1 CI

Issues 1

Files 9

Review log 2026

Show 1 earlier messages
  1. Garvin Hicking uploaded patch set 1 12/01/23, 19:15

  1. core-ci voted on patch set 1 V -1 12/01/23, 19:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50219

  2. Garvin Hicking uploaded patch set 2 V -1 12/01/23, 19:23

    CGL
  3. core-ci voted on patch set 2 V +1 12/01/23, 19:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50220

  4. Stefan Bürk commented on patch set 2 12/03/23, 22:37

    Some minor remarks, TBH not grasp the full impact yet. Need to re-review this change.
    Technically, adding a additional command option is a "feature" and thus main only. However, quite unsure of the impact here on a quick view if it "may be okay". TBH - don't checked the implementation in detail yet and need to re-review the patch with a fresh head.

    CleanUpLocalProcessedFilesCommand.php:53

    Quite unsure, but I guess I would go more with ``` 'remove-all` or 'clean-all' ``` here instead of "full-reset" - as it's a little bit more understandable by casual integrators and users. What do you think ?

    CleanUpLocalProcessedFilesService.php:134

    Please use ```php ->where(...array_values($conditions)) ``` here to avoid accidently key unpacking - and demonstrating `best behaviour`.
  5. Benni Mack commented on patch set 2 12/04/23, 07:04

    CleanUpLocalProcessedFilesCommand.php:53 Reply

    --all :)
  6. Garvin Hicking commented on patch set 2 12/04/23, 07:36

    CleanUpLocalProcessedFilesCommand.php:53 Reply

    > --all :) Sounds good to me, will rework. also I can cut out v12 as a backport, didn't do that intentionally 😅
  7. Garvin Hicking uploaded patch set 3 V +1 12/04/23, 09:39

    Added tests renamed command
  8. Garvin Hicking commented on patch set 3 12/04/23, 09:41

    I've now renamed the option to "--all". I've decided this should rather be a feature and be documented properly, thus removed the 12.4 backport. Added a feature RST and tests for the new option.

    CleanUpLocalProcessedFilesCommand.php:53 Reply

    Done

    CleanUpLocalProcessedFilesService.php:134 Reply

    Done
  9. core-ci voted on patch set 3 V +1 12/04/23, 09:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50306

  10. Garvin Hicking updated the commit message in patch set 4 V +1 12/21/23, 22:56

  11. core-ci voted on patch set 4 V +1 12/21/23, 23:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50886

  12. Simon Schaufelberger commented on patch set 4 12/22/23, 00:36

    ReferencedImage.png

    why such a huge image? wouldn't a 10x10px image also be enough?
  13. Garvin Hicking uploaded patch set 5 V +1 12/23/23, 16:34

    Reduced image file size
  14. core-ci voted on patch set 5 V +1 12/23/23, 16:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50939

  15. Garvin Hicking commented on patch set 5 12/23/23, 16:41

    ReferencedImage.png Reply

    I just used the same existing "NotReferencedImage" in that test actually. I don't find 1700 bytes to be huge, but I get your point and thanks for noticing. I switched the file with a 90byte image now. Maybe you could also comment/review on the patch itself, what do you think of it? BTW: There are many places in the core were large assets reside that could be cleaned up. Out of 33 static images provided in tests, 30 are larger than the 1700 bytes of the image in question: 14928 ./sysext/core/Tests/Unit/Type/Fixture/test.jpg 3334 ./sysext/core/Tests/Functional/Imaging/Fixtures/file.svg.jpg 393450 ./sysext/core/Tests/Functional/Imaging/Fixtures/file.bmp.jpg 4301 ./sysext/core/Tests/Functional/Imaging/Fixtures/file.pdf.jpg 3670 ./sysext/core/Tests/Functional/Imaging/Fixtures/file.tif.jpg 3000 ./sysext/core/Tests/Functional/Imaging/Fixtures/file.jpg 1778 ./sysext/core/Tests/Functional/Imaging/Fixtures/file.webp.jpg 3009 ./sysext/core/Tests/Functional/Imaging/Fixtures/file.png.jpg 603258 ./sysext/core/Tests/Functional/Imaging/Fixtures/file.ps.jpg 603232 ./sysext/core/Tests/Functional/Imaging/Fixtures/file.eps.jpg 3462 ./sysext/core/Tests/Functional/Imaging/Fixtures/file.fax.jpg 129076 ./sysext/core/Tests/Functional/Imaging/Fixtures/file.ai.jpg 166843 ./sysext/frontend/Tests/Functional/Fixtures/Images/team-t3board10.jpg 39037 ./sysext/frontend/Tests/Functional/Fixtures/Images/kasper-skarhoj1.jpg 5565 ./sysext/impexp/Tests/Functional/Fixtures/FileAssertions/typo3_image2_01.jpg 7958 ./sysext/impexp/Tests/Functional/Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg 5565 ./sysext/impexp/Tests/Functional/Fixtures/Folders/fileadmin/user_upload/typo3_image3.jpg 7425 ./sysext/impexp/Tests/Functional/Fixtures/Folders/fileadmin/user_upload/typo3_image5.jpg 8266 ./sysext/impexp/Tests/Functional/Fixtures/Folders/fileadmin/_processed_/csm_typo3_image2_5c2670fd59.jpg 22835 ./sysext/fluid/Tests/Functional/Fixtures/ViewHelpers/ImageViewHelperTest.jpg 166023 ./sysext/core/Tests/Unit/Type/Fixture/test.png 3009 ./sysext/core/Tests/Functional/Imaging/Fixtures/file.png 3000 ./sysext/core/Tests/Functional/Imaging/Fixtures/file.jpg.png 1936 ./sysext/core/Tests/Functional/DataHandling/FlexformIrre/Fixtures/fileadmin/typo3-logo.png I didn't want to mix changing these inside this patch, but if you'd like to create one, I'd be +1 for adjusting these in all cases, I think this is a fair point. :-)
  16. Garvin Hicking commented on patch set 5 12/23/23, 16:42

    ReferencedImage.png Reply

    Done
  17. Stefan Bürk commented on patch set 5 CR +1 V +1 12/26/23, 11:03

    Reply

    Done
  18. Guido Schmechel commented on patch set 5 12/28/23, 20:10

    full-reset -> all
  19. Garvin Hicking updated the commit message in patch set 6 CR +1 V +1 12/29/23, 11:33

  20. Garvin Hicking commented on patch set 6 12/29/23, 11:34

    Reply

    Done
  21. core-ci voted on patch set 6 V +1 12/29/23, 11:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50995

  22. Anja Leichsenring voted on patch set 6 CR +1 V +1 01/03/24, 06:48

  23. Guido Schmechel voted on patch set 6 CR +1 V +1 01/04/24, 11:59

  24. Stefan Bürk voted on patch set 6 CR +2 V +2 01/04/24, 14:12

  25. Stefan Bürk merged patch set 7 01/04/24, 14:12