-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.2] Reintroduce workaround for arguments passed by reference #38000
Conversation
This reverts commit 3a45d9a.
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? |
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. |
@joomdonation Maybe change that comment to something like pass by reference workaround? |
@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 ✅ successfully on 286ba9b This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38000. |
Thanks |
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
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.