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
260 stars 220 forks source link

BUG: Error by trying to delete assets which are still in use in the media browser #5085

Open GuangHa opened 1 month ago

GuangHa commented 1 month ago

Is there an existing issue for this?

Current Behavior

When you try to delete an asset which is still in use, you will get an internal error (500). Tried it in multiple installations.

image

An example of the exception message I get in the logs:

Exception in line 516 of /var/www/vhosts/staging.jumpbox.ch/httpdocs/releases/20240515104123/Data/Temporary/Production/Cache/Code/Flow_Object_Classes/Neos_Flow_Mvc_Controller_ActionController.php: Neos\Media\Browser\Controller\AssetController::deleteAction(): Argument #1 ($asset) must be of type Neos\Media\Domain\Model\Asset, null given, called in /var/www/vhosts/staging.jumpbox.ch/httpdocs/releases/20240515104123/Data/Temporary/Production/Cache/Code/Flow_Object_Classes/Neos_Flow_Mvc_Controller_ActionController.php on line 516

Expected Behavior

Another message, saying the asset is still in use and therefore unable to delete or maybe disable the delete function.

Steps To Reproduce

  1. Open media browser via Property-Editor
  2. Try to delete an asset in use
  3. Get Error

Environment

- Flow: 8.3.8
- Neos: 8.3.12
- PHP: 8.1.2

Anything else?

I found this issue but it is already closed: https://github.com/neos/neos-development-collection/issues/3349