From d590ada95f3585f332ea07363999be2aee6fb64d Mon Sep 17 00:00:00 2001 From: aB0t Date: Mon, 11 Mar 2024 18:22:04 +0200 Subject: [PATCH] Stable release of v4.0.0-alpha2 Fix the plug-in installer script builder bug #1067. Fix Event triggers for Joomla 4 and 5 builds. --- CHANGELOG.md | 9 +++-- ComponentbuilderInstallerScript.php | 2 +- README.md | 8 ++--- admin/README.txt | 8 ++--- .../{3.2.0-beta4.sql => 3.2.0-beta6.sql} | 0 admin/sql/updates/mysql/4.0.0-alpha1.sql | 1 + componentbuilder.xml | 4 +-- componentbuilder_update_server.xml | 22 ++++++++++-- .../Compiler/JoomlaFive/Event.php | 33 +++++++++--------- .../Compiler/JoomlaFour/Event.php | 34 ++++++++++--------- 10 files changed, 74 insertions(+), 47 deletions(-) rename admin/sql/updates/mysql/{3.2.0-beta4.sql => 3.2.0-beta6.sql} (100%) create mode 100644 admin/sql/updates/mysql/4.0.0-alpha1.sql 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 '
-

Upgrade to Version 4.0.0-alpha1 Was Successful! Let us know if anything is not working as expected.

'; +

Upgrade to Version 4.0.0-alpha2 Was Successful! Let us know if anything is not working as expected.

'; // Add/Update component in the action logs extensions table. $this->setActionLogsExtensions(); diff --git a/README.md b/README.md index 2d369d329..c983df118 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (4.0.0-alpha1) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (4.0.0-alpha2) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -145,12 +145,12 @@ TODO + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 + *Last Build*: 11th March, 2024 -+ *Version*: 4.0.0-alpha1 ++ *Version*: 4.0.0-alpha2 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **725229** ++ *Line count*: **725263** + *Field count*: **2078** -+ *File count*: **5115** ++ *File count*: **5116** + *Folder count*: **518** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). diff --git a/admin/README.txt b/admin/README.txt index 2d369d329..c983df118 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (4.0.0-alpha1) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (4.0.0-alpha2) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -145,12 +145,12 @@ TODO + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 + *Last Build*: 11th March, 2024 -+ *Version*: 4.0.0-alpha1 ++ *Version*: 4.0.0-alpha2 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **725229** ++ *Line count*: **725263** + *Field count*: **2078** -+ *File count*: **5115** ++ *File count*: **5116** + *Folder count*: **518** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). diff --git a/admin/sql/updates/mysql/3.2.0-beta4.sql b/admin/sql/updates/mysql/3.2.0-beta6.sql similarity index 100% rename from admin/sql/updates/mysql/3.2.0-beta4.sql rename to admin/sql/updates/mysql/3.2.0-beta6.sql diff --git a/admin/sql/updates/mysql/4.0.0-alpha1.sql b/admin/sql/updates/mysql/4.0.0-alpha1.sql new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/admin/sql/updates/mysql/4.0.0-alpha1.sql @@ -0,0 +1 @@ + diff --git a/componentbuilder.xml b/componentbuilder.xml index ce5e3e147..5efe80b48 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -7,9 +7,9 @@ https://dev.vdm.io Copyright (C) 2015 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 4.0.0-alpha1 + 4.0.0-alpha2 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()); } } }