diff --git a/platforms/joomla/mod_gantry5_particle/helper.php b/platforms/joomla/mod_gantry5_particle/helper.php index df55eda1c..c50a91e74 100644 --- a/platforms/joomla/mod_gantry5_particle/helper.php +++ b/platforms/joomla/mod_gantry5_particle/helper.php @@ -74,9 +74,10 @@ public static function ajax($id, $props = [], $format = 'raw') /** @var CMSApplication $app */ $app = Factory::getApplication(); - // Trigger the onRenderModule event. - $app->triggerEvent('onRenderModule', ['module' => &$module, 'attribs' => &$attribs]); + if ($app->get('dispatcher')) { + $app->get('dispatcher')->triggerEvent('onRenderModule', ['module' => &$module, 'attribs' => &$attribs]); + } $params = new Registry($module->params); $params->set('ajax', $props);