diff --git a/CHANGELOG.md b/CHANGELOG.md
index 56776335b..95c4ef433 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,12 @@
+# v4.0.0-alpha2
+
+- Fix the plug-in installer script builder bug #1067
+- Fix Event triggers for Joomla 4 and 5 builds.
+
# v4.0.0-alpha1
- First alpha release of Component Builder towards Joomla 4 (very unstable...)
-# v3.2.0-beta4
+# v3.2.0-beta6
-- Add Preferred Joomla Version to Components
\ No newline at end of file
+- Fix the plug-in installer script builder bug #1068
\ No newline at end of file
diff --git a/ComponentbuilderInstallerScript.php b/ComponentbuilderInstallerScript.php
index bce8ff320..261221969 100644
--- a/ComponentbuilderInstallerScript.php
+++ b/ComponentbuilderInstallerScript.php
@@ -3140,7 +3140,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface
echo '
Component Builder (v.4.0.0-alpha1)
+ Component Builder (v.4.0.0-alpha2)
The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.
diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml
index 4a65a223d..3fddfa5a0 100644
--- a/componentbuilder_update_server.xml
+++ b/componentbuilder_update_server.xml
@@ -5,10 +5,10 @@
pkg_component_builder
package
site
- 3.2.0-beta4
+ 3.2.0-beta6
https://dev.vdm.io
- https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.0-beta4.zip
+ https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.0-beta6.zip
beta
@@ -35,4 +35,22 @@
https://dev.vdm.io
+
+ Component Builder
+ Builds Complex Joomla Components
+ pkg_component_builder
+ package
+ site
+ 4.0.0-alpha2
+ https://dev.vdm.io
+
+ https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v4.0.0-alpha2.zip
+
+
+ beta
+
+ Llewellyn van der Merwe
+ https://dev.vdm.io
+
+
\ No newline at end of file
diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Event.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Event.php
index 245cf05d9..232fb6221 100644
--- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Event.php
+++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Event.php
@@ -26,13 +26,20 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
class Event implements EventInterface
{
/**
- * event plugin trigger switch
+ * event plug-in trigger switch
*
* @var boolean
* @since 3.2.0
*/
protected $activePlugins = false;
+ /**
+ * The application to trigger and event TODO
+ *
+ * @since 3.2.0
+ */
+ protected $dispatcher;
+
/**
* Constructor
*
@@ -60,6 +67,8 @@ class Event implements EventInterface
}
}
}
+
+ $this->dispatcher = Factory::getApplication();
}
/**
@@ -77,22 +86,14 @@ class Event implements EventInterface
// only execute if plugins were loaded (active)
if ($this->activePlugins)
{
- // Get the dispatcher.
- $dispatcher = \JEventDispatcher::getInstance();
-
- // Trigger this compiler event.
- $results = $dispatcher->trigger($event, $data);
-
- // Check for errors encountered while trigger the event
- if (count((array) $results) && in_array(false, $results, true))
+ try
{
- // Get the last error.
- $error = $dispatcher->getError();
-
- if (!($error instanceof \Exception))
- {
- throw new \Exception($error);
- }
+ // Trigger this compiler event.
+ $results = $this->dispatcher->triggerEvent($event, $data ?? []);
+ }
+ catch (\Exception $e)
+ {
+ throw new \Exception("Error processing event '$event': " . $e->getMessage());
}
}
}
diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Event.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Event.php
index d15c3292d..578f5f651 100644
--- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Event.php
+++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Event.php
@@ -12,6 +12,7 @@
namespace VDM\Joomla\Componentbuilder\Compiler\JoomlaFour;
+use Joomla\CMS\Factory;
use Joomla\Registry\Registry;
use Joomla\CMS\Plugin\PluginHelper;
use VDM\Joomla\Utilities\Component\Helper;
@@ -26,13 +27,20 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
final class Event implements EventInterface
{
/**
- * event plugin trigger switch
+ * event plug-in trigger switch
*
* @var boolean
* @since 3.2.0
*/
protected $activePlugins = false;
+ /**
+ * The application to trigger and event TODO
+ *
+ * @since 3.2.0
+ */
+ protected $dispatcher;
+
/**
* Constructor
*
@@ -60,6 +68,8 @@ final class Event implements EventInterface
}
}
}
+
+ $this->dispatcher = Factory::getApplication();
}
/**
@@ -77,22 +87,14 @@ final class Event implements EventInterface
// only execute if plugins were loaded (active)
if ($this->activePlugins)
{
- // Get the dispatcher.
- $dispatcher = \JEventDispatcher::getInstance();
-
- // Trigger this compiler event.
- $results = $dispatcher->trigger($event, $data);
-
- // Check for errors encountered while trigger the event
- if (count((array) $results) && in_array(false, $results, true))
+ try
{
- // Get the last error.
- $error = $dispatcher->getError();
-
- if (!($error instanceof \Exception))
- {
- throw new \Exception($error);
- }
+ // Trigger this compiler event.
+ $results = $this->dispatcher->triggerEvent($event, $data ?? []);
+ }
+ catch (\Exception $e)
+ {
+ throw new \Exception("Error processing event '$event': " . $e->getMessage());
}
}
}