No Code Attached Yet Information Required PHP 8.x
avatar beat
beat
21 Jan 2022

Steps to reproduce the issue

Go PHP 8.1, Enable debug, and see in backend the warnings

Expected result

No warnings

Actual result

Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in libraries/vendor/maximebf/debugbar/src/DebugBar/JavascriptRenderer.php on line 792

Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in libraries/vendor/maximebf/debugbar/src/DebugBar/JavascriptRenderer.php on line 792

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in libraries/vendor/maximebf/debugbar/src/DebugBar/JavascriptRenderer.php on line 808

Deprecated: Implicit conversion from float -INF to int loses precision in libraries/vendor/maximebf/debugbar/src/DebugBar/DataFormatter/DataFormatter.php on line 81

System information (as much as possible)

4.0.6, PHP 8.1.1

Additional comments

This file is not in the joomla/joomla-cms repository, where is it so I can propose a MR ?

The first 2 warnings are already fixed upstream here:
https://github.com/maximebf/php-debugbar/blob/master/src/DebugBar/JavascriptRenderer.php#L792-L794
and here:
https://github.com/maximebf/php-debugbar/blob/master/src/DebugBar/JavascriptRenderer.php#L810

For the last one, an (int) needs to be added like this, as arrays can have only int and string indices and floor() returns an int encoded as a float so the indice is an int, which corresponds to the natural array above:

return $sign . round(pow(1024, $base - floor($base)), $precision) . $suffixes[(int) floor($base)];

I have submitted a corresponding PR upstream here:
maximebf/php-debugbar#498

avatar beat beat - open - 21 Jan 2022
avatar joomla-cms-bot joomla-cms-bot - change - 21 Jan 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Jan 2022
avatar beat beat - change - 21 Jan 2022
Title
[4.0] [PHP 8.1] Debug plugin: 2 type issues
[4.0] [PHP 8.1] Debug plugin: 4 type issues
avatar beat beat - edited - 21 Jan 2022
avatar beat beat - change - 21 Jan 2022
Title
[4.0] [PHP 8.1] Debug plugin: 4 type issues
[4.0] [PHP 8.1] Debug plugin vendor maximebf/DebugBar: 4 type issues
avatar beat beat - edited - 21 Jan 2022
avatar beat beat - change - 21 Jan 2022
The description was changed
avatar beat beat - edited - 21 Jan 2022
avatar beat beat - change - 21 Jan 2022
Title
[4.0] [PHP 8.1] Debug plugin vendor maximebf/DebugBar: 4 type issues
[4.0] [PHP 8.1] Debug plugin (in vendor/maximebf/DebugBar): 4 type issues
avatar beat beat - edited - 21 Jan 2022
avatar beat beat - change - 21 Jan 2022
Title
[4.0] [PHP 8.1] Debug plugin (in vendor/maximebf/DebugBar): 4 type issues
[4.0] [PHP 8.1] Debug plugin: 4 type issues (in vendor/maximebf/DebugBar):
avatar beat beat - edited - 21 Jan 2022
avatar brianteeman
brianteeman - comment - 21 Jan 2022

This file is not in the joomla/joomla-cms repository, where is it so I can propose a MR ?

That is correct. It is pulled in via composer. The current version as defined in the composer.lock is the latest release

The issues already fixed there (probably #494 by @alikon just need to be "released"

avatar brianteeman
brianteeman - comment - 21 Jan 2022

In summary - you've done all you can and there is no need for an open issue here and this can be closed.

avatar beat beat - change - 21 Jan 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-01-21 17:03:30
Closed_By beat
avatar beat beat - close - 21 Jan 2022
avatar beat
beat - comment - 21 Jan 2022

ok, closing then.

avatar beat
beat - comment - 11 Feb 2022

There are other issues that are not committed, and Joomla 4.1 will be issuing those errors if they or we don't fix them. E.g. See my PR here:
#36772
What should we do ? just ship with the error, or manually fix the remaining PHP 8.1 incompatibilities during the build process ?

avatar beat beat - change - 11 Feb 2022
Status Closed New
Closed_Date 2022-01-21 17:03:30
Closed_By beat
avatar beat beat - reopen - 11 Feb 2022
avatar beat beat - change - 11 Feb 2022
Title
[4.0] [PHP 8.1] Debug plugin: 4 type issues (in vendor/maximebf/DebugBar):
[4.1] [PHP 8.1] Debug plugin: 4 type issues (in vendor/maximebf/DebugBar):
avatar beat beat - edited - 11 Feb 2022
avatar Quy Quy - change - 15 Mar 2022
Labels Added: ?
avatar Quy Quy - labeled - 15 Mar 2022
avatar laoneo
laoneo - comment - 5 Apr 2022

@beat, can this one here be closed as for me it looks like a duplicate of #37274?

avatar Quy Quy - change - 6 Apr 2022
Labels Added: Information Required PHP 8.x
Removed: ?
avatar Quy Quy - labeled - 6 Apr 2022
avatar Quy Quy - labeled - 6 Apr 2022
avatar Quy Quy - labeled - 6 Apr 2022
avatar Quy Quy - labeled - 6 Apr 2022
avatar Quy Quy - close - 13 Apr 2022
avatar Quy
Quy - comment - 13 Apr 2022

Closing per PR #37488.

avatar Quy Quy - change - 13 Apr 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-04-13 19:40:49
Closed_By Quy

Add a Comment

Login with GitHub to post a comment