From aba1267f8ecc351dddb47e8c717fcb5f3f48533a Mon Sep 17 00:00:00 2001 From: aB0t Date: Thu, 16 May 2024 16:07:17 +0200 Subject: [PATCH] Release of v5.0.1-alpha2 Fix permission issue for admin views. --- CHANGELOG.md | 6 ++++- ComponentbuilderInstallerScript.php | 2 +- README.md | 10 ++++----- admin/README.txt | 10 ++++----- admin/sql/updates/mysql/5.0.1-alpha.sql | 1 + componentbuilder.xml | 6 ++--- componentbuilder_update_server.xml | 22 +++++++++++++++++-- .../src/Abstraction/ActiveRegistry.php | 19 +++++++++++++++- .../Compiler/Builder/DatabaseKeys.php | 15 +++++++++++++ .../Compiler/Creator/AccessSections.php | 5 +++-- .../Compiler/Model/Permissions.php | 13 ++++++++++- .../Extrusion/Helper/Mapping.php | 2 +- 12 files changed, 89 insertions(+), 22 deletions(-) create mode 100644 admin/sql/updates/mysql/5.0.1-alpha.sql diff --git a/CHANGELOG.md b/CHANGELOG.md index eca7cbd49..83f6f5fb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ -# v5.0.1-alpha1 +# v5.0.1-alpha2 + +- Fix permission issue for admin views. + +# v5.0.1-alpha - Fix auto build from SQL in Joomla 5. diff --git a/ComponentbuilderInstallerScript.php b/ComponentbuilderInstallerScript.php index fa8bd898a..c16ef3048 100644 --- a/ComponentbuilderInstallerScript.php +++ b/ComponentbuilderInstallerScript.php @@ -3210,7 +3210,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface echo '
-

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

'; +

Upgrade to Version 5.0.1-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 3b42319cf..2ed3d5eca 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 (5.0.1-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 (5.0.1-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) @@ -144,13 +144,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 13th May, 2024 -+ *Version*: 5.0.1-alpha1 ++ *Last Build*: 16th May, 2024 ++ *Version*: 5.0.1-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*: **746313** ++ *Line count*: **746470** + *Field count*: **2097** -+ *File count*: **5288** ++ *File count*: **5289** + *Folder count*: **528** > 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 3b42319cf..2ed3d5eca 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 (5.0.1-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 (5.0.1-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) @@ -144,13 +144,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 13th May, 2024 -+ *Version*: 5.0.1-alpha1 ++ *Last Build*: 16th May, 2024 ++ *Version*: 5.0.1-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*: **746313** ++ *Line count*: **746470** + *Field count*: **2097** -+ *File count*: **5288** ++ *File count*: **5289** + *Folder count*: **528** > 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/5.0.1-alpha.sql b/admin/sql/updates/mysql/5.0.1-alpha.sql new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/admin/sql/updates/mysql/5.0.1-alpha.sql @@ -0,0 +1 @@ + diff --git a/componentbuilder.xml b/componentbuilder.xml index c3e836d11..92418f3f5 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@ COM_COMPONENTBUILDER - 13th May, 2024 + 16th May, 2024 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io Copyright (C) 2015 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 5.0.1-alpha1 + 5.0.1-alpha2 Component Builder (v.5.0.1-alpha1) +

Component Builder (v.5.0.1-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 63b623492..1d14c89ee 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -59,10 +59,28 @@ pkg_component_builder package site - 5.0.1-alpha1 + 5.0.1-alpha https://dev.vdm.io - https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v5.0.1-alpha1.zip + https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v5.0.1-alpha2.zip + + + alpha + + Llewellyn van der Merwe + https://dev.vdm.io + + + + Component Builder + Builds Complex Joomla Components + pkg_component_builder + package + site + 5.0.1-alpha2 + https://dev.vdm.io + + https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v5.0.1-alpha2.zip alpha diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Abstraction/ActiveRegistry.php b/libraries/vendor_jcb/VDM.Joomla/src/Abstraction/ActiveRegistry.php index 861fcf962..e714bd291 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Abstraction/ActiveRegistry.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Abstraction/ActiveRegistry.php @@ -40,6 +40,14 @@ abstract class ActiveRegistry implements Activeregistryinterface **/ protected bool $addAsArray = false; + /** + * Base switch to keep array values unique + * + * @var boolean + * @since 3.2.2 + **/ + protected bool $uniqueArray = false; + /** * Check if the registry has any content. * @@ -157,7 +165,16 @@ abstract class ActiveRegistry implements Activeregistryinterface // Convert to array if it's not already an array $array = [$array]; } - $array[] = $value; + + if ($this->uniqueArray && in_array($value, $array)) + { + // we do nothing + return; + } + else + { + $array[] = $value; + } } else { diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Builder/DatabaseKeys.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Builder/DatabaseKeys.php index e9496c54c..3c3cce1db 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Builder/DatabaseKeys.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Builder/DatabaseKeys.php @@ -23,5 +23,20 @@ use VDM\Joomla\Abstraction\Registry; */ final class DatabaseKeys extends Registry implements Registryinterface { + /** + * Base switch to add values as string or array + * + * @var boolean + * @since 3.2.0 + **/ + protected bool $addAsArray = true; + + /** + * Base switch to keep array values unique + * + * @var boolean + * @since 3.2.2 + **/ + protected bool $uniqueArray = true; } diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Creator/AccessSections.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Creator/AccessSections.php index 28fe04300..d59a3ce92 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Creator/AccessSections.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Creator/AccessSections.php @@ -460,7 +460,7 @@ final class AccessSections } } - $this->permission ->set( + $this->permission->set( $custom_admin_view, $customAdminCode, $customAdminCode, $menuControllers, 'customAdmin' ); @@ -661,7 +661,8 @@ final class AccessSections } } } - $this->permission ->set( + + $this->permission->set( $view, $nameView, $nameViews, $menuControllers ); } diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Model/Permissions.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Model/Permissions.php index 3c03e4911..45957f9e6 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Model/Permissions.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Model/Permissions.php @@ -39,7 +39,18 @@ class Permissions if (ArrayHelper::check($item->addpermissions)) { - $item->permissions = array_values($item->addpermissions); + if (isset($item->addpermissions["action"]) && is_array($item->addpermissions["action"]) + && isset($item->addpermissions["implementation"]) && is_array($item->addpermissions["implementation"])) + { + foreach ($item->addpermissions["action"] as $k => $action) + { + $item->permissions[] = ['action' => $action, 'implementation' => $item->addpermissions["implementation"][$k]]; + } + } + else + { + $item->permissions = array_values($item->addpermissions); + } } unset($item->addpermissions); diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Extrusion/Helper/Mapping.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Extrusion/Helper/Mapping.php index d9cc09abd..0247ecc7c 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Extrusion/Helper/Mapping.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Extrusion/Helper/Mapping.php @@ -34,7 +34,7 @@ class Mapping protected $buildcompsql; public $id; public $name_code; - public array $addadmin_views; + public array $addadmin_views = []; public array $addSql = []; public array $source = []; public array $sql = [];