[5.4][PHP8.5] Using null as the key parameter for array_key_exists() is deprecated - #46736
Conversation
|
I have tested this item ✅ successfully on b746e24 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46736. |
|
I can't reproduce the error before the patch, can you give me an advise? I enabled logging and look into the administrator/logs folder. In none of the files, also not in deprecated is the error you mentioned. |
In JBT I can reproduce the problem in using php8.5, enable 'System - Language Filter' plugin and visit the frontend. The deprecated message is in |
|
I cant replicate the reported error on either j5 or 6 |
|
I have tested this item ✅ successfully on b746e24
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46736. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46736. |
@coolcat-creations It needs PHP error reporting set to maximum and PHP to be configured to log errors into a log file - this can be an extra PHP log or the log file of the webserver (e.g. Apache), depending on the particular environment, and most of all it needs PHP 8.5 for reproducing the issue.
@brianteeman Did you environment fulfil the above conditions? |
|
Yes it did and as you know i've regularly worked on deprecated issues and created pull requests in the past. Weird that this one didn't come up but from code review it should have done and this fix is good |
|
I have tested this item ✅ successfully on ffebc88 Thanks @heelc29! This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46736. |
Summary of Changes
https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_using_values_null_as_an_array_offset_and_when_calling_array_key_exists
Testing Instructions
After you have applied the PR you have to clean the session (eg. close the browser)
Actual result BEFORE applying this Pull Request
deprecation message (only visible in log file, because redirect)
Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in \plugins\system\languagefilter\src\Extension\LanguageFilter.phpExpected result AFTER applying this Pull Request
no deprecation message
Link to documentations
Please select: