Patch to fix the bug in the new custom_tabs area to insure the full list of tab names are loaded every time

This commit is contained in:
Llewellyn van der Merwe 2018-08-25 23:17:42 +02:00
parent 7ef25c2bb1
commit be0d61ceae
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
3 changed files with 11 additions and 5 deletions

View File

@ -129,7 +129,7 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
+ *Version*: 2.9.0 + *Version*: 2.9.0
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **192673** + *Line count*: **192685**
+ *Field count*: **1081** + *Field count*: **1081**
+ *File count*: **1273** + *File count*: **1273**
+ *Folder count*: **201** + *Folder count*: **201**

View File

@ -129,7 +129,7 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
+ *Version*: 2.9.0 + *Version*: 2.9.0
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **192673** + *Line count*: **192685**
+ *Field count*: **1081** + *Field count*: **1081**
+ *File count*: **1273** + *File count*: **1273**
+ *Folder count*: **201** + *Folder count*: **201**

View File

@ -45,13 +45,19 @@ class JFormFieldViewtabs extends JFormFieldList
$query->from($db->quoteName('#__componentbuilder_admin_view', 'a')); $query->from($db->quoteName('#__componentbuilder_admin_view', 'a'));
if ($fieldsID > 0) 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); $query->where($db->quoteName('b.id') . ' = ' . (int) $fieldsID);
} }
else else
{ {
// get the refs if found // get the refs if found
$ref = $jinput->get('ref', 0, 'WORD'); $ref = $jinput->get('ref', null, 'WORD');
$refid = $jinput->getInt('refid', 0); $refid = $jinput->getInt('refid', 0);
if ('admin_view' === $ref && $refid > 0) if ('admin_view' === $ref && $refid > 0)
{ {
@ -68,7 +74,7 @@ class JFormFieldViewtabs extends JFormFieldList
$db->setQuery((string)$query); $db->setQuery((string)$query);
$item = $db->loadObject(); $item = $db->loadObject();
$options = array(); $options = array();
if (isset($item->addtabs) && strlen($item->addtabs) > 5) if (isset($item->addtabs) && ComponentbuilderHelper::checkJson($item->addtabs))
{ {
$items = json_decode($item->addtabs, true); $items = json_decode($item->addtabs, true);
$nr = 1; $nr = 1;