From f048c5c29f687bb426bebd5deed90a329dd874fa Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 24 Jan 2018 14:47:57 +0200 Subject: [PATCH] Made little fix to search of local Joomla component on JCB package import --- README.md | 2 +- admin/README.txt | 2 +- admin/models/import_joomla_components.php | 8 +++- admin/models/joomla_components.php | 50 +++++++++++------------ 4 files changed, 34 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 260527395..2cde40c78 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ Component Builder is mapped as a component in itself on my local development env + *Version*: 2.6.13 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **180832** ++ *Line count*: **180838** + *Field count*: **1577** + *File count*: **1161** + *Folder count*: **186** diff --git a/admin/README.txt b/admin/README.txt index 260527395..2cde40c78 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -130,7 +130,7 @@ Component Builder is mapped as a component in itself on my local development env + *Version*: 2.6.13 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **180832** ++ *Line count*: **180838** + *Field count*: **1577** + *File count*: **1161** + *Folder count*: **186** diff --git a/admin/models/import_joomla_components.php b/admin/models/import_joomla_components.php index 301102914..475acea98 100644 --- a/admin/models/import_joomla_components.php +++ b/admin/models/import_joomla_components.php @@ -2265,10 +2265,16 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy } break; case 'joomla_component': - if ($retry == 2) + if ($retry == 3) + { + // get by name only + $getter = array('name', 'name_code'); // risky will look at this again + } + elseif ($retry == 2) { // get by name ... $getter = array('name', 'name_code', 'short_description', 'author', 'email', 'component_version', 'companyname', 'system_name', 'website', 'bom', 'copyright', 'license'); // risky will look at this again + $retryAgain = 3; } else { diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php index 4500df277..efe3cd9cc 100644 --- a/admin/models/joomla_components.php +++ b/admin/models/joomla_components.php @@ -1586,31 +1586,31 @@ class ComponentbuilderModelJoomla_components extends JModelList return false; } - /** - * Method to get header. - * - * @return mixed An array of data items on success, false on failure. - */ - public function getExImPortHeaders() - { - // Get a db connection. - $db = JFactory::getDbo(); - // get the columns - $columns = $db->getTableColumns("#__componentbuilder_joomla_component"); - if (ComponentbuilderHelper::checkArray($columns)) - { - // remove the headers you don't import/export. - unset($columns['asset_id']); - unset($columns['checked_out']); - unset($columns['checked_out_time']); - $headers = new stdClass(); - foreach ($columns as $column => $type) - { - $headers->{$column} = $column; - } - return $headers; - } - return false; + /** + * Method to get header. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getExImPortHeaders() + { + // Get a db connection. + $db = JFactory::getDbo(); + // get the columns + $columns = $db->getTableColumns("#__componentbuilder_joomla_component"); + if (ComponentbuilderHelper::checkArray($columns)) + { + // remove the headers you don't import/export. + unset($columns['asset_id']); + unset($columns['checked_out']); + unset($columns['checked_out_time']); + $headers = new stdClass(); + foreach ($columns as $column => $type) + { + $headers->{$column} = $column; + } + return $headers; + } + return false; } /**