User tests: Successful: Unsuccessful:
Pull Request for Issue # .
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.
$children = [];
$list = HTMLHelper::_('menu.treerecurse', 0, '', [], $children, 9999, 0, 0);
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
No warnings anymore.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
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.
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?
Labels |
Added:
?
|
@richard67 I updated the comment. Hope it is more clear/accurate now.
Then I would adjust the title as it is not a revert anymore.
I have tested this item
Tested successfully in Joomla 4.2.0-beta1-dev of 9 June in Wampserver 3.2.9 using PHP 8.0.15
Title |
|
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-06-09 05:47:26 |
Closed_By | ⇒ | HLeithner |
Thanks
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?