From 7448403a461d2c40f327bce091bcf5bf685c3e00 Mon Sep 17 00:00:00 2001 From: aB0t Date: Mon, 11 Mar 2024 18:14:39 +0200 Subject: [PATCH] Stable release of v3.2.0-beta6 Fix the plug-in installer script builder bug #1068. Fix Event triggers for Joomla 4 and 5 builds. --- CHANGELOG.md | 5 +++ README.md | 8 ++--- admin/README.txt | 8 ++--- admin/sql/updates/mysql/3.2.0-beta5.sql | 1 + componentbuilder.xml | 4 +-- componentbuilder_update_server.xml | 18 ++++++++++ .../Compiler/JoomlaFive/Event.php | 33 +++++++++--------- .../Compiler/JoomlaFour/Event.php | 34 ++++++++++--------- script.php | 2 +- 9 files changed, 70 insertions(+), 43 deletions(-) create mode 100644 admin/sql/updates/mysql/3.2.0-beta5.sql diff --git a/CHANGELOG.md b/CHANGELOG.md index f85ab540d..e312d4f71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# v3.2.0-beta6 + +- Fix the plug-in installer script builder bug #1068 +- Fix Event triggers for Joomla 4 and 5 builds. + # v3.2.0-beta5 - Add custom file file mapping for Joomla 4 and 5 diff --git a/README.md b/README.md index 2196150ff..c597cb20c 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 (3.2.0-beta5) 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 (3.2.0-beta6) 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*: 3.2.0-beta5 ++ *Version*: 3.2.0-beta6 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **738787** ++ *Line count*: **738821** + *Field count*: **2078** -+ *File count*: **5199** ++ *File count*: **5200** + *Folder count*: **459** > 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 2196150ff..c597cb20c 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 (3.2.0-beta5) 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 (3.2.0-beta6) 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*: 3.2.0-beta5 ++ *Version*: 3.2.0-beta6 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **738787** ++ *Line count*: **738821** + *Field count*: **2078** -+ *File count*: **5199** ++ *File count*: **5200** + *Folder count*: **459** > 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-beta5.sql b/admin/sql/updates/mysql/3.2.0-beta5.sql new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/admin/sql/updates/mysql/3.2.0-beta5.sql @@ -0,0 +1 @@ + diff --git a/componentbuilder.xml b/componentbuilder.xml index 52696abf7..7c456e880 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 - 3.2.0-beta5 + 3.2.0-beta6 Component Builder (v.3.2.0-beta5) +

Component Builder (v.3.2.0-beta6)

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 5818eb907..e4ff629bb 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -1613,4 +1613,22 @@ https://dev.vdm.io + + Component Builder + Builds Complex Joomla Components + pkg_component_builder + package + site + 3.2.0-beta6 + https://dev.vdm.io + + https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.0-beta6.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()); } } } diff --git a/script.php b/script.php index 994e52e31..a1eb2f85a 100644 --- a/script.php +++ b/script.php @@ -9618,7 +9618,7 @@ class Com_ComponentbuilderInstallerScript echo '

-

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

'; +

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

'; // Set db if not set already. if (!isset($db))