From 850ee4b7e92e05f0be6fa0ad55aa29e1a24e7469 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 13 Nov 2019 05:36:42 +0200 Subject: [PATCH] Added the feature that stops plugins from being exported as part of JCB package --- README.md | 4 ++-- admin/README.txt | 4 ++-- admin/helpers/compiler/a_Get.php | 2 +- admin/models/joomla_components.php | 15 +++++++++++++++ componentbuilder.xml | 2 +- 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 91045a102..40be687f1 100644 --- a/README.md +++ b/README.md @@ -143,11 +143,11 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 9th November, 2019 ++ *Last Build*: 13th November, 2019 + *Version*: 2.10.5 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **255982** ++ *Line count*: **255997** + *Field count*: **1351** + *File count*: **1614** + *Folder count*: **256** diff --git a/admin/README.txt b/admin/README.txt index 91045a102..40be687f1 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -143,11 +143,11 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 9th November, 2019 ++ *Last Build*: 13th November, 2019 + *Version*: 2.10.5 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **255982** ++ *Line count*: **255997** + *Field count*: **1351** + *File count*: **1614** + *Folder count*: **256** diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index d0cc2df6b..9f7514fe6 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -6234,7 +6234,7 @@ class Get $joomla_plugins = array_filter( array_values($addjoomla_plugins), function($array){ - // only load the plugins whose target association calles for it + // only load the plugins whose target association call for it if (!isset($array['target']) || $array['target'] != 2) { return true; diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php index 0a121d991..29b095bec 100644 --- a/admin/models/joomla_components.php +++ b/admin/models/joomla_components.php @@ -749,6 +749,21 @@ class ComponentbuilderModelJoomla_components extends JModelList // actions to take if table is component_plugins if ('component_plugins' === $table) { + // we remove those plugins not part of the export + if (isset($item->addjoomla_plugins) && ComponentbuilderHelper::checkJson($item->addjoomla_plugins)) + { + $item->addjoomla_plugins = array_filter( + json_decode($item->addjoomla_plugins, true), + function ($plugin) { + // target 2 is only export and target 0 is both (1 is only compile) + if (isset($plugin['target']) && ($plugin['target'] == 2 || $plugin['target'] == 0)) + { + return true; + } + return false; + } + ); + } // add custom admin views $this->setData('joomla_plugin', $this->getValues($item->addjoomla_plugins, 'subform', 'plugin'), 'id'); } diff --git a/componentbuilder.xml b/componentbuilder.xml index 4399aca30..082b2eb96 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 9th November, 2019 + 13th November, 2019 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com