Core dispatch sites still passed event arguments by reference, tagged @todo: Remove reference in Joomla 6/7. Every one of these sites reads the value back from the event after dispatch, so listeners that change an argument through the event's update*() method keep working. Legacy listeners that changed a by-reference parameter in place no longer affect the result; that is the deprecated behaviour this removes, documented in the manual entry. onValidateContact never allowed changing the data and has no setter. This removes the & at all 21 tagged sites: contact, installer, module, menu, form, custom fields and privacy events.
Nothing in core listens by reference. The matching removal of the reference handling inside the event constructors is #47459.
Testing Instructions
Apply the patch and clear the cache.
Site: submit the contact form of a published contact. The email arrives with the submitted name, subject and message.
API: POST /api/index.php/v1/contact/form/{id} with the same fields and a valid token. Response is 200 and the email arrives.
Administrator: install an extension from upload and from a URL (System > Install), then run Update Sites > Find Updates.
Site and administrator: load pages with modules in several positions and check they render with their chrome.
Administrator: open Menus > Main Menu > New > Select, the list of menu item types loads. Browse the administrator menu and a submenu module.
Administrator: create a custom field for articles, edit and save an article, the field value is shown on the site.
Administrator: the Privacy Status dashboard module shows the privacy policy status.
Optional, for plugins: a plugin subscribed to onSubmitContact that calls $event->updateData([...]) still changes the email content. A plugin subscribed to onRenderModule that calls updateAttributes() still changes the module chrome.
Actual result BEFORE applying this Pull Request
Everything works.
Expected result AFTER applying this Pull Request
Identical. No behaviour change in any of the steps above.
Link to documentations
No documentation changes for guide.joomla.org needed