? ? PHP 8.x Pending

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
21 Mar 2022

Summary of Changes

The menu table adds some checks if the values are empty. On PHP 8.1 these checks do throw a deprecated message when the value is null. For example on:
trim(): Passing null to parameter 1 ($string) of type string is deprecated in /libraries/src/Table/Menu.php on line 128

This happens only when doing a discover install with DPDocker, so it can be merged as code review.

avatar laoneo laoneo - open - 21 Mar 2022
avatar laoneo laoneo - change - 21 Mar 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 21 Mar 2022
Category Libraries
avatar laoneo laoneo - change - 21 Mar 2022
The description was changed
avatar laoneo laoneo - edited - 21 Mar 2022
avatar joomdonation
joomdonation - comment - 21 Mar 2022

I have tested this item successfully on deba857

Confirm the issue by installing an extension and check PHP error logs. This PR does solves the issue, so I gave it a successful test

Personal, I would change the code a bit to:

if ($this->path === null || trim($this->path) === '')

OR:

if (trim($this->path ?? '') === '')

Also, during installation, the only line which is having issue is line 128. The changes for other lines are just for consistency only (data for the other fields are populated in already).


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37337.
avatar joomdonation joomdonation - test_item - 21 Mar 2022 - Tested successfully
avatar laoneo laoneo - change - 21 Mar 2022
Title
[4.0] Check if attributes have a value before trimming in menu table
[4.1] Check if attributes have a value before trimming in menu table
avatar laoneo laoneo - edited - 21 Mar 2022
avatar alikon
alikon - comment - 21 Mar 2022

I have tested this item successfully on deba857


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37337.

avatar alikon alikon - test_item - 21 Mar 2022 - Tested successfully
avatar alikon alikon - change - 21 Mar 2022
Status Pending Ready to Commit
avatar alikon
alikon - comment - 21 Mar 2022

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37337.

avatar bembelimen
bembelimen - comment - 24 Mar 2022

I have tested this item ? unsuccessfully on deba857


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37337.

avatar bembelimen bembelimen - test_item - 24 Mar 2022 - Tested unsuccessfully
avatar bembelimen
bembelimen - comment - 24 Mar 2022

grafik

avatar laoneo laoneo - change - 25 Mar 2022
Labels Added: ? ? ? PHP 8.x
avatar laoneo
laoneo - comment - 25 Mar 2022

Good catch, fixed it with a null check in a0678b1? Do you want to again some tests?

avatar bembelimen bembelimen - change - 7 Apr 2022
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-04-07 00:30:30
Closed_By bembelimen
Labels Removed: ?
avatar bembelimen bembelimen - close - 7 Apr 2022
avatar bembelimen bembelimen - merge - 7 Apr 2022
avatar bembelimen
bembelimen - comment - 7 Apr 2022

Thx

Add a Comment

Login with GitHub to post a comment