User tests: Successful: Unsuccessful:
Pull Request for Issue # none.
Fixes Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in libraries/src/Log/Log.php on line 387
With call-stack:
1 | 0.0001 | 373216 | {main}( ) | .../index.php:0
2 | 0.0001 | 373968 | require_once( '/home/beat/www/4.0/includes/app.php ) | .../index.php:32
3 | 0.0092 | 985176 | Joomla\CMS\Application\CMSApplication->execute( ) | .../app.php:63
4 | 0.0096 | 1067760 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:278
5 | 0.0987 | 2766720 | Joomla\CMS\Application\SiteApplication->dispatch( $component = ??? ) | .../SiteApplication.php:243
6 | 0.1001 | 2761952 | Joomla\CMS\Component\ComponentHelper::renderComponent( $option = 'com_ajax', $params = ??? ) | .../SiteApplication.php:204
7 | 0.1006 | 2784232 | Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch( ) | .../ComponentHelper.php:389
8 | 0.1007 | 2786136 | Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure:/home/beat/www/4.0/libraries/src/Dispatcher/LegacyComponentDispatcher.php:68-70}( $path = '/home/beat/www/4.0/components/com_ajax/ajax.php' ) | .../LegacyComponentDispatcher.php:71
9 | 0.1007 | 2788312 | require_once( '/home/beat/www/4.0/components/com_ajax/ajax.php ) | .../LegacyComponentDispatcher.php:69
10 | 0.1008 | 2792728 | Joomla\CMS\Log\Log::add( $entry = 'Please specify a valid response format, other than that of HTML, such as json, raw, debug, etc.', $priority = 8, $category = ???, $date = ???, $context = ??? ) | .../ajax.php:265
11 | 0.1010 | 2799720 | Joomla\CMS\Log\Log->addLogEntry( $entry = class Joomla\CMS\Log\LogEntry { public $category = NULL; public $context = []; public $date = class Joomla\CMS\Date\Date { protected $tz = class DateTimeZone { ... }; public $date = '2022-02-11 20:59:49.174797'; public $timezone_type = 3; public $timezone = 'UTC' }; public $message = 'Please specify a valid response format, other than that of HTML, such as json, raw, debug, etc.'; public $priority = 8; protected $priorities = [0 => 1, 1 => 2, 2 => 4, 3 => 8, 4 => 16, 5 => 32, 6 => 64, 7 => 128]; public $callStack = [0 => [...], 1 => [...], 2 => [...], 3 => [...], 4 => [...], 5 => [...], 6 => [...], 7 => [...], 8 => [...], 9 => [...]] } ) | .../Log.php:175
12 | 0.1010 | 2799720 | Joomla\CMS\Log\Log->findLoggers( $priority = 8, $category = NULL ) | .../Log.php:333
13 | 0.1010 | 2799720 | strtolower( $string = NULL ) | .../Log.php:387
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 attribute public $category;
, like public $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 $category
is passed to it, here:
https://github.com/joomla/joomla-cms/blob/4.1-dev/libraries/src/Log/LogEntry.php#L115
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)
Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in libraries/src/Log/Log.php on line 387
That error is not displayed anymore.
None.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
?
|
I have tested this item
I have tested this item
After following your instructions the error described in the PR was gone. Only now an other error emerged: Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in ***\components\com_ajax\ajax.php on line 39. This will probably being fixed in an other PR.
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
PHP 8.x
Removed: ? |
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-04-02 07:52:21 |
Closed_By | ⇒ | laoneo |
Thanks!
I have tested this item✅ successfully on 7cf3a41
Tested successfully in Joomla 4.1.0-rc4 using PHP 8.1.2
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37009.