schmitzal / tinyimg

TYPO3-Extension which compresses images (png & jpg) uploaded in the backend with the tinypng API
GNU General Public License v3.0
15 stars 11 forks source link

Determine storage folder correctly #24

Closed kraemer-igroup closed 6 years ago

kraemer-igroup commented 6 years ago

Hi,

with debugging enabled within the TYPO3 backend I got this PHP Warning instead of a running Command Task:
_Execution of task "Extbase CommandController Task (extbase)" failed with the following message: PHP Warning: explode() expects parameter 2 to be string, object given in C:\Users\ank\Downloads\typo3src-8.7.15\typo3\sysext\core\Classes\Utility\GeneralUtility.php line 1302

I found the responsible code part and tried to fix it. In my opinion it now should work as intented, but you should also look over it and test it with multiple storages. Reason was the method "getFolderObjectFromCombinedIdentifier" became a folder object but wanted a string like '1:user_upload/'. The fallback is to use the default storage which in most cases I guess was sufficient.

schmitzal commented 6 years ago

Many thanks for the PR.

Opened a new PR with changes: #27

So closed.