Closed paptikant closed 1 year ago
or if (array_key_exists('single', $data)) { ... }
this is fixed in v11 and I don't plan to provide updates to 10x branch, especially not for such stuff - patch it yourself with composer or update to v11. hope you understand
Yah, looks like you would have to fix more than one of those: PHP Warning: Undefined array key "l10n_mode" in /var/www/html/public/typo3conf/ext/news/Classes/Service/AccessControlService.php line 98
this has been fixed with https://github.com/georgringer/news/commit/2c2417e2d9282ef122c0b0905aeeba385f87a52d
just update to v11 ;)
The comment was meant to mean, that I understand your position; - I do keep falling over those issues in v10, though, and I undestand that you are not keen to fix them twice, assuming that you fixed them for v11. "Just update" is sometimes easier typed than done, though. Anyway, thank you for your time and work. It's appreciated.
i fully understand that - as a "solution" you could supress such warnings btw
Bug Report
Current Behavior If the search returns no result (searching for a rubish string, eg. "slkxcsdf") an Exception is thrown: PHP Warning: Undefined array key "single" in /var/www/html/public/typo3conf/ext/news/Classes/Domain/Repository/NewsRepository.php line 411
Expected behavior/output no exception
Environment
Possible Solution Wrap the code from line 411 to 419 into another if checking if the array key is defined:
Additional context I assume the problem has to do with: In PHP < 8.1 undefined array key was a notice and usually not displayed as error (depending on your PHP/TYPO3 configuration). Since PHP 8.1 it's a warning and is usually displayed as an error.
I have not checked if the issue is fixed in a higher version, ie. v11.0 upwards. Would be nice to get this patched for the people still using v10, though.