diff --git a/componentbuilderactionlogcompiler.xml b/componentbuilderactionlogcompiler.xml index 460a3ce..30aa4e2 100644 --- a/componentbuilderactionlogcompiler.xml +++ b/componentbuilderactionlogcompiler.xml @@ -1,7 +1,7 @@ PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER - 15th February, 2023 + 26th February, 2023 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io diff --git a/script.php b/script.php index aeefba1..59d5a5c 100644 --- a/script.php +++ b/script.php @@ -57,10 +57,13 @@ class plgExtensionComponentbuilderActionLogCompilerInstallerScript $app->enqueueMessage('Joomla Component Builder must first be installed from Joomla Component Builder.', 'error'); return false; } + // load the helper class JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php'); + // block install $blockInstall = true; + // check the version of JCB $manifest = ComponentbuilderHelper::manifest(); if (isset($manifest->version) && strpos($manifest->version, '.') !== false) @@ -78,12 +81,14 @@ class plgExtensionComponentbuilderActionLogCompilerInstallerScript $blockInstall = false; } } + // allow install if all conditions are met if ($blockInstall) { - $app->enqueueMessage('Please upgrade to JCB-Pro v3.0.0 or higher before installing this plugin.', 'error'); + $app->enqueueMessage('Please upgrade to JCB v3.0.0 or higher before installing this plugin.', 'error'); return false; - } + } + // check that componentbuilder is installed $pathToCore = JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php';