neos / neos-development-collection

The unified repository containing the Neos core packages, used for Neos development.
https://www.neos.io/
GNU General Public License v3.0
266 stars 223 forks source link

Deleting an image from media browser should also delete associated thumbnails #2336

Closed Benjamin-K closed 1 year ago

Benjamin-K commented 5 years ago

Description

When removing an image through the media browser all created thumbnails for this image still exist and can be accessed. Removing the images with ./flow media:clearthumbnails and ./flow resource:clean (afterwards) did not remove the thumbnails either. The images have to be removed from the server by hand. This is a big problem when it comes to data privacy and you get a request to remove some images.

Steps to Reproduce

  1. Place an image on a website so some thumbnails are being generated.
  2. Copy the links to the thumbnail URIs.
  3. Remove the image from all used places used on the website.
  4. Delete the image through the Media Browser.
  5. Run ./flow media:clearthumbnails and ./flow resource:clean (optional, should not be needed IMO).
  6. Check the thumbnail URIs and see that the thumbnails still exist.

Expected behavior

When deleting an image through the Media Browser, i expect the Thumbnails of the image to also be removed.

Actual behavior

The thumbnails of the image still exist.

Affected Versions

Neos: 3.3.16 (i did not test other versions) Flow: 4.3.12 (i did not test other versions)

jonnitto commented 5 years ago

Good catch, thanks @Benjamin-K for the report. @robertlemke, can you take a look at this?

Fiach commented 5 years ago

Hello @robertlemke,

I've analyzed this issue and could reproduce the error in the named version 3.3.16. I also tested this in Major Version 4.0 and the issue is occurring there as well.

The good news is that with Version 5.0 this issue is not occurring.

I've got a suspicion that it may lay on the Doctrine Packages.

Below is a list of the doctrine packages:

NEOS 4.0 

doctrine/annotations               v1.8.0             Docblock Annotations Parser
doctrine/cache                     v1.8.0             Caching library offering an object-oriented API for many cache backends
doctrine/collections               v1.6.2             PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.
doctrine/common                    v2.7.3             Common Library for Doctrine projects
doctrine/dbal                      v2.7.2             Database Abstraction Layer
doctrine/inflector                 v1.3.0             Common String Manipulations with regard to casing and singular/plural rules.
doctrine/instantiator              1.2.0              A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer                     1.1.0              PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
doctrine/migrations                v1.6.2             Database Schema migrations using Doctrine DBAL
doctrine/orm                       v2.6.4             Object-Relational-Mapper for PHP
gedmo/doctrine-extensions          v2.4.37            Doctrine2 behavioral extensions
phpdocumentor/reflection-common    2.0.0              Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock  4.3.2              With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
phpdocumentor/type-resolver        1.0.1              A PSR-5 based resolver of Class names, Types and Structural Element Names

NEOS 5.0

doctrine/annotations               v1.8.0             Docblock Annotations Parser
doctrine/cache                     v1.8.0             Caching library offering an object-oriented API for many cache backends
doctrine/collections               v1.6.2             PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.
doctrine/common                    v2.11.0            PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects depend on such as better reflection support, persistence interfaces,...
doctrine/dbal                      v2.9.2             Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.
doctrine/event-manager             v1.0.0             Doctrine Event Manager component
doctrine/inflector                 v1.3.0             Common String Manipulations with regard to casing and singular/plural rules.
doctrine/instantiator              1.2.0              A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer                     1.1.0              PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
doctrine/migrations                v1.8.1             Database Schema migrations using Doctrine DBAL
doctrine/orm                       v2.6.4             Object-Relational-Mapper for PHP
doctrine/persistence               1.1.1              The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.
doctrine/reflection                v1.0.0             Doctrine Reflection component
gedmo/doctrine-extensions          v2.4.37            Doctrine2 behavioral extensions
phpdocumentor/reflection-common    2.0.0              Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock  4.3.2              With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
phpdocumentor/type-resolver        1.0.1              A PSR-5 based resolver of Class names, Types and Structural Element Names
dlubitz commented 1 year ago

Tested with Neos 7.3 and the thumbails got deleted as expected. As @Fiach already stated out, it might get fixed in a previous Neos version.