beechit / fal_securedownload

An extension for TYPO3 CMS which adds secure downloads to FAL
36 stars 62 forks source link

Exception "Folder "[name]" does not exist in "/path/to/parent/[name]" when cut and paste a folder #206

Closed sdelcroix closed 1 year ago

sdelcroix commented 1 year ago

Hi,

in TYPO3 v11, when we cut a folder and paste it in the destination folder, an exception is thrown.

#1329836110 InvalidArgumentException
Folder "test" does not exist in "/Public/Icones/test/"

The error occurs in FolderChangedEventListener.php line 73 :

$newFolder = $event->getTargetFolder()->getSubfolder($event->getTargetFolder()->getName());

There's no need to get the subfolder of the target folder 'cause getTargetFolder() already returns the new folder. So this simple following change seems to fix the issue :

$newFolder = $event->getTargetFolder();
FamousWolf commented 1 year ago

Thanks. I've implemented and tested your solution. It will be included in the next release.