-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.1] [PHP 8.1] Fixes Deprecated: strtolower(): Passing null to string in libraries/src/Log/Log.php on line 387 #37009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I have tested this item ✅ successfully on 7cf3a41 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37009. |
…src/Log/Log.php on line 387` Fixes `Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in libraries/src/Log/Log.php on line 387`
@beat I think this would better, or do we have any potential b/c with it? |
|
I have tested this item ✅ successfully on 4f8d6b5 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37009. |
|
I have tested this item ✅ successfully on 4f8d6b5 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37009. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37009. |
|
Thanks! |
Pull Request for Issue # none.
Summary of Changes
Fixes
Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in libraries/src/Log/Log.php on line 387With call-stack:
This is a code-safe B/C fix.
There is an alternate fix possible, which is to give a default value of empty string
''in LogEntry to its attributepublic $category;, likepublic $category = '';here:https://github.com/joomla/joomla-cms/blob/4.1-dev/libraries/src/Log/LogEntry.php#L31
or to initialize it to empty string in its constructor when no
$categoryis passed to it, here:https://github.com/joomla/joomla-cms/blob/4.1-dev/libraries/src/Log/LogEntry.php#L115
Testing Instructions
Code review or:
In PHP 8.1 with debug on, go to:
http://localhost/.../index.php/component/ajax/?plugin=RunSchedulerWebcron&group=system&hash=ERoRNEvIxx8cLCIho0T2(without &format=raw to better see the error, but with &format=raw error is there too)
Actual result BEFORE applying this Pull Request
Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in libraries/src/Log/Log.php on line 387Expected result AFTER applying this Pull Request
That error is not displayed anymore.
Documentation Changes Required
None.