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 AbstractController.php #41

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: PHP Warning: Undefined array key "_LOCALIZED_UID" in ext/generic_gallery/Classes/Controller/AbstractController.php line 85

$this->uid = $data['_LOCALIZED_UID'] ?: $data['uid'];

To fix this warning change the line to:

$this->uid = array_key_exists('_LOCALIZED_UID', $data) && $data['_LOCALIZED_UID'] ?: $data['uid'];

fnagel commented 2 years ago

Hello @matcolton, thanks for your contribution!

I thought those kind of warnings are more a PHP 8.x issue. Anyway, 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! And your right, it was PHP 8.0. Shame on me! :)

fnagel commented 2 years ago

No problem :-) Thanks for repoting and testing!