From 1dd9f75efc3e8fea79d9eeff3a9b8ebf75a022ad Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Thu, 13 Feb 2020 14:24:13 +0200 Subject: [PATCH] Resolved gh-511 to ensure that all linked custom fields and rules are indeed moved to the plugins and modules related. --- README.md | 2 +- admin/README.txt | 2 +- admin/helpers/compiler/b_Structure.php | 39 ++++++++++++++++++-------- componentbuilder.xml | 2 +- 4 files changed, 30 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 36c6149a8..5a2b8f321 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ 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*: 12th February, 2020 ++ *Last Build*: 13th February, 2020 + *Version*: 2.10.11 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt diff --git a/admin/README.txt b/admin/README.txt index 36c6149a8..5a2b8f321 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -144,7 +144,7 @@ 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*: 12th February, 2020 ++ *Last Build*: 13th February, 2020 + *Version*: 2.10.11 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index b78d1d693..5f3d3bf93 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -235,6 +235,13 @@ class Structure extends Get */ public $extentionCustomfields = array(); + /** + * Extention Tracking Files Moved + * + * @var array + */ + public $extentionTrackingFilesMoved = array(); + /** * The standard folders * @@ -1808,26 +1815,34 @@ class Structure extends Get // check if this is a custom field that should be moved if (isset($this->extentionCustomfields[$field['type_name']])) { - // check files exist - if (JFile::exists($this->componentPath . '/admin/models/fields/' . $field['type_name'] . '.php')) + // lets check if we already moved this + if (!isset($this->extentionTrackingFilesMoved[$path . 'type' . $field['type_name']])) { - // copy the custom field - JFile::copy($this->componentPath . '/admin/models/fields/' . $field['type_name'] . '.php', $path . '/fields/' . $field['type_name'] . '.php'); + // check files exist + if (JFile::exists($this->componentPath . '/admin/models/fields/' . $field['type_name'] . '.php')) + { + // copy the custom field + JFile::copy($this->componentPath . '/admin/models/fields/' . $field['type_name'] . '.php', $path . '/fields/' . $field['type_name'] . '.php'); + } + // stop from doing this again. + $this->extentionTrackingFilesMoved[$path . 'type' . $field['type_name']] = true; } - // do this just once - unset($this->extentionCustomfields[$field['type_name']]); } // check if this has validation that should be moved if (isset($this->validationLinkedFields[$field['field']])) { - // check files exist - if (JFile::exists($this->componentPath . '/admin/models/rules/' . $this->validationLinkedFields[$field['field']] . '.php')) + // lets check if we already moved this + if (!isset($this->extentionTrackingFilesMoved[$path . 'rule' . $this->validationLinkedFields[$field['field']]])) { - // copy the custom field - JFile::copy($this->componentPath . '/admin/models/rules/' . $this->validationLinkedFields[$field['field']] . '.php', $path . '/rules/' . $this->validationLinkedFields[$field['field']] . '.php'); + // check files exist + if (JFile::exists($this->componentPath . '/admin/models/rules/' . $this->validationLinkedFields[$field['field']] . '.php')) + { + // copy the custom field + JFile::copy($this->componentPath . '/admin/models/rules/' . $this->validationLinkedFields[$field['field']] . '.php', $path . '/rules/' . $this->validationLinkedFields[$field['field']] . '.php'); + } + // stop from doing this again. + $this->extentionTrackingFilesMoved[$path . 'rule' . $this->validationLinkedFields[$field['field']]] = true; } - // do this just once - unset($this->validationLinkedFields[$field['field']]); } } diff --git a/componentbuilder.xml b/componentbuilder.xml index e50b4eb32..40efcd715 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 12th February, 2020 + 13th February, 2020 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com