diff --git a/README.md b/README.md index 79e1095c9..9fe20249c 100644 --- a/README.md +++ b/README.md @@ -144,11 +144,11 @@ 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*: 4th February, 2020 ++ *Last Build*: 9th 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 -+ *Line count*: **281315** ++ *Line count*: **281319** + *Field count*: **1505** + *File count*: **1770** + *Folder count*: **280** diff --git a/admin/README.txt b/admin/README.txt index 79e1095c9..9fe20249c 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -144,11 +144,11 @@ 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*: 4th February, 2020 ++ *Last Build*: 9th 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 -+ *Line count*: **281315** ++ *Line count*: **281319** + *Field count*: **1505** + *File count*: **1770** + *Folder count*: **280** diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 76778b6ca..aeaaddb44 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -3613,15 +3613,14 @@ class Get // array(join_field_as, join_field) $bucket['join_field'] = array_map('trim', explode('.', $op['join_field'])); // triget filed that has table a relationship - if ($bucket['on_field'][0] === 'a' || + if ($op['row_type'] == 1 && ($bucket['on_field'][0] === 'a' || isset($_part_of_a[$bucket['on_field'][0]]) || - isset($_part_of_a[$bucket['join_field'][0]])) + isset($_part_of_a[$bucket['join_field'][0]]))) { $_part_of_a[$op['as']] = $op['as']; } return $bucket; }, $result->join_view_table); - // loop joints foreach ($result->join_view_table as $nr => &$option) { @@ -3679,9 +3678,9 @@ class Get // array(join_field_as, join_field) $bucket['join_field'] = array_map('trim', explode('.', $op['join_field'])); // triget filed that has table a relationship - if ($bucket['on_field'][0] === 'a' || + if ($op['row_type'] == 1 && ($bucket['on_field'][0] === 'a' || isset($_part_of_a[$bucket['on_field'][0]]) || - isset($_part_of_a[$bucket['join_field'][0]])) + isset($_part_of_a[$bucket['join_field'][0]]))) { $_part_of_a[$op['as']] = $op['as']; } diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index f1cdecdb3..0b520c995 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -2734,12 +2734,25 @@ class Fields extends Structure elseif (isset($field['settings']->datatype)) { // insure default not none if number type - $intKeys = array('INT', 'TINYINT', 'BIGINT', 'FLOAT', 'DECIMAL', 'DOUBLE'); - if (in_array($field['settings']->datatype, $intKeys)) + $numberKeys = array('INT', 'TINYINT', 'BIGINT', 'FLOAT', 'DECIMAL', 'DOUBLE'); + // don't use these as index or uniqe keys + $textKeys = array('TEXT', 'TINYTEXT', 'MEDIUMTEXT', 'LONGTEXT', 'BLOB', 'TINYBLOB', 'MEDIUMBLOB', 'LONGBLOB'); + // build the query values + $this->queryBuilder[$view_name_single][$name]['type'] = $field['settings']->datatype; + // check if this is a number + if (in_array($field['settings']->datatype, $numberKeys)) { if ($field['settings']->datadefault === 'Other') { - if (!is_numeric($field['settings']->datadefault_other) || $field['settings']->datadefault_other !== '0000-00-00 00:00:00') + // setup the checking + $number_check = $field['settings']->datadefault_other; + // Decimals in SQL needs some help + if ('DECIMAL' === $field['settings']->datatype && !is_numeric($number_check)) + { + $number_check = str_replace(',', '.', $field['settings']->datadefault_other); + } + // check if we have a valid number value + if (!is_numeric($number_check)) { $field['settings']->datadefault_other = '0'; } @@ -2749,10 +2762,7 @@ class Fields extends Structure $field['settings']->datadefault = '0'; } } - // don't use these as index or uniqe keys - $textKeys = array('TEXT', 'TINYTEXT', 'MEDIUMTEXT', 'LONGTEXT', 'BLOB', 'TINYBLOB', 'MEDIUMBLOB', 'LONGBLOB'); - // build the query values - $this->queryBuilder[$view_name_single][$name]['type'] = $field['settings']->datatype; + // check if this is not text if (!in_array($field['settings']->datatype, $textKeys)) { $this->queryBuilder[$view_name_single][$name]['lenght'] = $field['settings']->datalenght; @@ -2760,6 +2770,7 @@ class Fields extends Structure $this->queryBuilder[$view_name_single][$name]['default'] = $field['settings']->datadefault; $this->queryBuilder[$view_name_single][$name]['other'] = $field['settings']->datadefault_other; } + // fall back unto EMPTY for text else { $this->queryBuilder[$view_name_single][$name]['default'] = 'EMPTY'; diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 7bc5d4145..9bceeabc6 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -1637,10 +1637,10 @@ class Interpretation extends Fields { // to insure that there be no double entries of a call $checker = md5(serialize($the_get) . $code); - if (!isset($this->customViewQueryChecker[$this->target]) || !in_array($checker, $this->customViewQueryChecker[$this->target])) + if (!isset($this->customViewQueryChecker[$this->target]) || !isset($checker, $this->customViewQueryChecker[$this->target][$checker])) { // load this unuiqe key - $this->customViewQueryChecker[$this->target][] = $checker; + $this->customViewQueryChecker[$this->target][$checker] = true; if (isset($the_get['selection']['type']) && ComponentbuilderHelper::checkString($the_get['selection']['type'])) { $getItem = PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get from " . $the_get['selection']['table'] . " as " . $the_get['as']; @@ -1673,7 +1673,9 @@ class Interpretation extends Fields // set the method defaults if (($default = $this->setCustomViewMethodDefaults($the_get, $code)) !== false) { - if (isset($this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]) && ComponentbuilderHelper::checkString($this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]) && !in_array($check, $mainAsArray)) + if (isset($this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]) + && ComponentbuilderHelper::checkString($this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]) + && !in_array($check, $mainAsArray)) { // load to other query if (!isset($this->otherQuery[$this->target][$default['code']][$this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']])) @@ -4458,7 +4460,7 @@ class Interpretation extends Fields else { // insure the form is added (only if no form exist) - if ('admin' === $this->target && strpos($view['settings']->default, 'target && strpos($view['settings']->default, 'addCustomForm[$this->target][$view['settings']->code] = true; } diff --git a/admin/views/assistant/tmpl/default.php b/admin/views/assistant/tmpl/default.php index 8e79b5bd5..f9e5c8336 100644 --- a/admin/views/assistant/tmpl/default.php +++ b/admin/views/assistant/tmpl/default.php @@ -34,6 +34,7 @@ JHtml::_('behavior.keepalive'); } item->id)) ? '&id='. (int) $this->item->id : ''; ?> +
+ + + +

diff --git a/componentbuilder.xml b/componentbuilder.xml index c8b4818b2..85676782d 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 4th February, 2020 + 9th February, 2020 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com