fnagel / generic-gallery

TYPO3 extension: Generic Gallery - One gallery to rule them all!
https://extensions.typo3.org/extension/generic_gallery/
GNU General Public License v3.0
7 stars 12 forks source link

PHP Warning in PageLayoutViewHook.php #40

Closed matcolton closed 2 years ago

matcolton commented 2 years ago

After installing the current version (5.1.0) of generic_gallery with PHP 7.4 and Typo3 11 the following warning is shown: Undefined array key "BACK_PATH" in /ext/generic_gallery/Classes/Backend/Hooks/PageLayoutViewHook.php line 173 It refers to the following code:

$this->imagePreviewHtml = BackendUtility::thumbCode(
    $this->data,
    'tt_content',
    'tx_generic_gallery_images',
    $GLOBALS['BACK_PATH']
 );

The method thumbCode only accepts three params anyway. The fix is to remove the last parameter.

fnagel commented 2 years ago

Afaics the thumbCode method does except a lot more arguments but $backPath is no longer in use (see screenshot from TYPO3 11.5.8). Seems like this is the case for TYPO3 10 too.

image

Removed the useless third parameter. Thanks for reporting! I've pushed a change to master branch. Would you mind to test if this works for you?

matcolton commented 2 years ago

Great, works perfectly now. Thanks! I actually only looked at the Class List (master), the options aren't listed there. Wierd, should be auto-generated.