Fatal error when no storage selected
First of all, thank you for this and your other extensions.
Thanks to a user uploading everything to the root of his storage I encountered this small problem:
When I try to crop an image in the root folder of a storage without selecting the storage first, the storageId in the function "getFileData" is 0 which leads to the following error:
Fatal error: Call to a member function getFile() on a non-object in [...]\typo3conf\ext\k23_imagecrop\Classes\Service\File.php on line 17
I don't know if there is any way to get the real storageId in this case but if there isn't, I think the user should see a notice, like "please select a folder first" or something like that, without the script throwing a fatal error.
Tested on 6.2.4 and a new installation of 6.2.9 with only the default storage without sub folders and only image crop installed.
#2 Updated by Philip W almost 5 years ago
Hendrik Reimers wrote:
Thank you for your issue. Could you explain a task on how you not selecting a storage? I think if you go in the Filemanager Module it's automaticly selected isnt so?
That's what I thought as well.
But when I want to crop an image in the root of the first visible storage for the first time after logging in, it will not work if I do not select the folder/storage first.
Once you select a folder it will work until you log out.
How you should encounter the error: upload an image directly to the root of the first storage you see in the Filemanager Module. Log out, log in again, then try to crop this image without selecting any folder first. This is how I reproduced it in the new installation.