No Code Attached Yet
avatar PhocaCz
PhocaCz
16 Nov 2021

Hi,

I didn't find any information about this issue:

#20966 (comment)

in

https://docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_4

If it is not, it would be good to add it, this can be very useful information for developers.

In Short:

Plugin events with name, which does not start with "on" work in Joomla 3 but do not work in Joomla 4 (no error or warning message, plugin event is just ignored).

Each Joomla plugin event function where the name does not start with "on" needs to be changed to name starting with "on".

This does not affect only function in plugins but even the call in extensions.

Plugin:
FROM:
public function SpecificPluginGroupBefore...
TO:
public function onSpecificPluginGroupBefore...

Extension
FROM:
Factory::getApplication()->triggerEvent('SpecificPluginGroupBefore...'
TO:
Factory::getApplication()->triggerEvent('onSpecificPluginGroupBefore ...'

I still didn't find the reason why this convention was not strict in J3 but in J4, but at least it will be great to document it for other developers starting to overwrite their extension.

avatar PhocaCz PhocaCz - open - 16 Nov 2021
avatar joomla-cms-bot joomla-cms-bot - change - 16 Nov 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 16 Nov 2021
avatar HLeithner
HLeithner - comment - 16 Nov 2021

Thanks for finding this, it would be great if you could update the documentation too.

avatar PhocaCz
PhocaCz - comment - 16 Nov 2021

Done

avatar alikon
alikon - comment - 16 Nov 2021

thank you

p.s
close the issue then ?

avatar PhocaCz PhocaCz - change - 16 Nov 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-11-16 18:11:05
Closed_By PhocaCz
avatar PhocaCz PhocaCz - close - 16 Nov 2021
avatar akfaisel
akfaisel - comment - 15 Feb 2023

I was wasting half of the day "on" this issue.

Add a Comment

Login with GitHub to post a comment