? Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
7 Jun 2022

Pull Request for Issue # .

Summary of Changes

This PR revert the change introduced in PR #37178 because it causes some warnings when use HTMLHelper to call a helper method which need parameters passed by reference.

Testing Instructions

  1. Use 4.2 nightly build
  2. Open administrator/templates/atum/index.php , add two lines of code below somewhere in that file:
$children = [];
$list      = HTMLHelper::_('menu.treerecurse', 0, '', [], $children, 9999, 0, 0);
  1. Access to administrator area of the site

Actual result BEFORE applying this Pull Request

Warnings message is displayed line below:

Warning
Parameter 4 to Joomla\CMS\HTML\Helpers\Menu::treerecurse() expected to be a reference, value given in
D:\www\joomla42\libraries\src\HTML\HTMLHelper.php
on line
289

Expected result AFTER applying this Pull Request

No warnings anymore.

avatar joomdonation joomdonation - open - 7 Jun 2022
avatar joomdonation joomdonation - change - 7 Jun 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 7 Jun 2022
Category Libraries
avatar simbus82
simbus82 - comment - 7 Jun 2022

Joomla 4 doesn't support php 5 and pass by reference is deprecated since PHP 5. Why re-add some obsolete code in J4.2?

avatar joomdonation
joomdonation - comment - 7 Jun 2022

I'm unsure if the comment PHP 5.3 workaround here is correct. The fact is that some of our helper methods like https://github.com/joomla/joomla-cms/blob/4.1-dev/libraries/src/HTML/Helpers/Menu.php#L422 has parameter passed by reference. And without reverting the PR, calling these methods will cause warnings as I mentioned in PR description

You can try to test the code yourself to see the issue.

avatar richard67
richard67 - comment - 7 Jun 2022

I'm unsure if the comment PHP 5.3 workaround here is correct.

@joomdonation Maybe change that comment to something like pass by reference workaround?

avatar joomdonation joomdonation - change - 7 Jun 2022
Labels Added: ?
avatar joomdonation
joomdonation - comment - 7 Jun 2022

@richard67 I updated the comment. Hope it is more clear/accurate now.

avatar laoneo
laoneo - comment - 7 Jun 2022

Then I would adjust the title as it is not a revert anymore.

avatar toivo toivo - test_item - 9 Jun 2022 - Tested successfully
avatar toivo
toivo - comment - 9 Jun 2022

I have tested this item successfully on 286ba9b

Tested successfully in Joomla 4.2.0-beta1-dev of 9 June in Wampserver 3.2.9 using PHP 8.0.15


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

avatar HLeithner HLeithner - change - 9 Jun 2022
Title
[4.2] Revert #37178
[4.2] Reintroduce workaround for arguments passed by reference
avatar HLeithner HLeithner - edited - 9 Jun 2022
avatar HLeithner HLeithner - change - 9 Jun 2022
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-06-09 05:47:26
Closed_By HLeithner
avatar HLeithner HLeithner - close - 9 Jun 2022
avatar HLeithner HLeithner - merge - 9 Jun 2022
avatar HLeithner
HLeithner - comment - 9 Jun 2022

Thanks

Add a Comment

Login with GitHub to post a comment