I have a plugin that looks like this:

class plgExtensionLogInstall extends JPlugin

    function onExtensionAfterInstall($installer, $extensionId) 
        JLog::add("Extension installed: ".$extensionId, JLog::DEBUG, 'plg_extension_log_install);

This installs correctly and I can enable it, but when I install another extension it is never triggered.

Putting some extra logging in /libraries/joomla/event/dispatcher.php I can see two event listeners hooked to onextensionafterinstall but neither of them is mine. The Extension XML file only contains the standard extension description and a files section like this:

<extension version="3.1" type="plugin" group="extension">
    <name>Plugin Logger</name>
        <filename plugin="installer_log">installer_log.php</filename>

The event is never triggered, but if the code is broken it does crash when the installer would run. What is missing from my class or configuration?

| improve this question | | | | |

Plugin class name must match the plugin name defined in manifest file.

If you have this in the manifest:


Then class name should be PlgExtensionInstaller_Log.

Other way around, if class is PlgExtensionLogInstall, then manifest should contain this:

<filename plugin="loginstall">loginstall.php</filename>
| improve this answer | | | | |
  • 1
    That was it! One of the problems with design by convention is that it can be very hard to figure out which parts are design-critical. – glenatron Jul 8 '19 at 15:40

Your Answer

