From be0d61ceae784c3d610eeff285701dc605c6f500 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sat, 25 Aug 2018 23:17:42 +0200 Subject: [PATCH] Patch to fix the bug in the new custom_tabs area to insure the full list of tab names are loaded every time --- README.md | 2 +- admin/README.txt | 2 +- admin/models/fields/viewtabs.php | 12 +++++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 295e5b570..bf2fd3b78 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo + *Version*: 2.9.0 + *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **192673** ++ *Line count*: **192685** + *Field count*: **1081** + *File count*: **1273** + *Folder count*: **201** diff --git a/admin/README.txt b/admin/README.txt index 295e5b570..bf2fd3b78 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -129,7 +129,7 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo + *Version*: 2.9.0 + *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **192673** ++ *Line count*: **192685** + *Field count*: **1081** + *File count*: **1273** + *Folder count*: **201** diff --git a/admin/models/fields/viewtabs.php b/admin/models/fields/viewtabs.php index e21e65508..7ebc920e2 100644 --- a/admin/models/fields/viewtabs.php +++ b/admin/models/fields/viewtabs.php @@ -45,13 +45,19 @@ class JFormFieldViewtabs extends JFormFieldList $query->from($db->quoteName('#__componentbuilder_admin_view', 'a')); if ($fieldsID > 0) { - $query->join('LEFT', $db->quoteName('#__componentbuilder_admin_fields', 'b') . ' ON (' . $db->quoteName('a.id') . ' = ' . $db->quoteName('b.admin_view') . ')'); + $viewName = $jinput->get('view', null, 'WORD'); + // only allow for fields and custom tabs + if ('admin_fields' !== $viewName && 'admin_custom_tabs' !== $viewName) + { + return false; + } + $query->join('LEFT', $db->quoteName('#__componentbuilder_' . $viewName, 'b') . ' ON (' . $db->quoteName('a.id') . ' = ' . $db->quoteName('b.admin_view') . ')'); $query->where($db->quoteName('b.id') . ' = ' . (int) $fieldsID); } else { // get the refs if found - $ref = $jinput->get('ref', 0, 'WORD'); + $ref = $jinput->get('ref', null, 'WORD'); $refid = $jinput->getInt('refid', 0); if ('admin_view' === $ref && $refid > 0) { @@ -68,7 +74,7 @@ class JFormFieldViewtabs extends JFormFieldList $db->setQuery((string)$query); $item = $db->loadObject(); $options = array(); - if (isset($item->addtabs) && strlen($item->addtabs) > 5) + if (isset($item->addtabs) && ComponentbuilderHelper::checkJson($item->addtabs)) { $items = json_decode($item->addtabs, true); $nr = 1;