Skip to content
Permalink
Browse files

Resolved gh-511 to ensure that all linked custom fields and rules are…

… indeed moved to the plugins and modules related.
  • Loading branch information
Llewellynvdm committed Feb 13, 2020
1 parent a6cdafb commit 1dd9f75efc3e8fea79d9eeff3a9b8ebf75a022ad
Showing with 30 additions and 15 deletions.
  1. +1 −1 README.md
  2. +1 −1 admin/README.txt
  3. +27 −12 admin/helpers/compiler/b_Structure.php
  4. +1 −1 componentbuilder.xml
@@ -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
@@ -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
@@ -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 @@ public function moveFieldsRules($field, $path)
// 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']]);
}
}

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name>
<creationDate>12th February, 2020</creationDate>
<creationDate>13th February, 2020</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>

0 comments on commit 1dd9f75

Please sign in to comment.
You can’t perform that action at this time.