[4.1] [PHP 8.1] Fixes Deprecated: strtolower(): Passing null to string in libraries/src/Log/Log.php on line 387#37009
Merged
laoneo merged 5 commits intojoomla:4.1-devfrom Apr 2, 2022
Merged
Conversation
Contributor
|
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`
Member
@beat I think this would better, or do we have any potential b/c with it? |
Member
|
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. |
Member
|
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. |
Member
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37009. |
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.