PHP 8.x bug PR-4.3-dev ? Pending

User tests: Successful: Unsuccessful:

avatar crystalenka
crystalenka
17 Feb 2023

Summary of Changes

Passing null to md5 is deprecated in 8.1

Testing Instructions

code review

Actual result BEFORE applying this Pull Request

Deprecated notice:

Deprecated: md5(): Passing null to parameter #1 ($string) of type string is deprecated in libraries/src/Document/Document.php on line 634

Expected result AFTER applying this Pull Request

No notice

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed

  • No documentation changes for manual.joomla.org needed

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar joomla-cms-bot joomla-cms-bot - change - 17 Feb 2023
Category Libraries
avatar crystalenka crystalenka - open - 17 Feb 2023
avatar crystalenka crystalenka - change - 17 Feb 2023
Status New Pending
avatar joomdonation
joomdonation - comment - 17 Feb 2023

In case $content is null, we should not add it to _style array. I would early return in this case. So add the lines of code below to beginning of the method to prevent warning:

if ($content === null) {
	return $this;
}

In the future (not sure if Joomla 5 is suitable), we should use string type for $content parameter so that we do not have to add ugly code like that.

avatar crystalenka crystalenka - change - 17 Feb 2023
Labels Added: ?
avatar crystalenka
crystalenka - comment - 17 Feb 2023

Updated, thank you @joomdonation

avatar crystalenka crystalenka - change - 9 Mar 2023
Labels Added: ? PHP 8.x ?
avatar crystalenka
crystalenka - comment - 9 Mar 2023

I think I fixed the code style but the build was killed somehow?

avatar laoneo
laoneo - comment - 9 Mar 2023

I restarted it.

avatar crystalenka
crystalenka - comment - 9 Mar 2023

Thank you! Looks like it's good now.

avatar joomdonation joomdonation - test_item - 9 Mar 2023 - Tested successfully
avatar joomdonation
joomdonation - comment - 9 Mar 2023

I have tested this item successfully on 9914810

Code review.


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

avatar HLeithner
HLeithner - comment - 2 May 2023

This pull request has been automatically rebased to 4.3-dev.

avatar crystalenka crystalenka - change - 10 May 2023
Labels Added: bug
Removed: ?
avatar crystalenka
crystalenka - comment - 10 May 2023

We need just one more test, this is tiny. Can someone review it so it can be merged into the next release?

avatar richard67
richard67 - comment - 10 May 2023

@crystalenka When you do a branch update, test counter in the issue tracker is reset, so you have to add back the test result with use of the issue tracker (button "Alter test"). Otherwise nobody will find it when filtering by "Has 2 test" or "Needs 1 test". I will do that for you now, but in future please avoid unnecessary branch updates.

avatar richard67
richard67 - comment - 10 May 2023

Ah I just see the PR has been rebased, so it needs new tests anyway.

avatar crystalenka crystalenka - change - 13 Jul 2023
Labels Added: PR-4.3-dev
Removed: ?
avatar crystalenka
crystalenka - comment - 13 Jul 2023

@richard67 it has been rebased, but it's a very minor change (just ~3 lines of code). Hopefully it can be tested and merged soon. ?

avatar drdehart
drdehart - comment - 8 Aug 2023

We tested this fix in a 4.3.3 / PHP 8.1.21 build, the issue is actually on line 649 of Document.php for this build, and it looks great. FWIW


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

avatar obuisard obuisard - change - 28 Aug 2023
Labels Added: ?
avatar obuisard obuisard - change - 28 Aug 2023
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-08-28 18:19:44
Closed_By obuisard
Labels Removed: ?
avatar obuisard obuisard - close - 28 Aug 2023
avatar obuisard obuisard - merge - 28 Aug 2023
avatar obuisard
obuisard - comment - 28 Aug 2023

Thanks Crystal @crystalenka for the PR!

Add a Comment

Login with GitHub to post a comment