From a05efdbb332154b0da6b186752a2e5b56d51e53b Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Tue, 8 Dec 2020 06:32:39 +0200 Subject: [PATCH] Sets the code name of custom views before the model even, so it can be used in the event. --- README.md | 10 +++++----- admin/README.txt | 10 +++++----- admin/helpers/compiler/a_Get.php | 13 ++++++------- componentbuilder.xml | 2 +- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 7c160b90d..69a4902e5 100644 --- a/README.md +++ b/README.md @@ -144,14 +144,14 @@ 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*: 7th December, 2020 ++ *Last Build*: 8th December, 2020 + *Version*: 2.12.1 + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **288998** -+ *Field count*: **1537** -+ *File count*: **1902** -+ *Folder count*: **304** ++ *Line count*: **289396** ++ *Field count*: **1545** ++ *File count*: **1912** ++ *Folder count*: **310** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/README.txt b/admin/README.txt index 7c160b90d..69a4902e5 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -144,14 +144,14 @@ 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*: 7th December, 2020 ++ *Last Build*: 8th December, 2020 + *Version*: 2.12.1 + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **288998** -+ *Field count*: **1537** -+ *File count*: **1902** -+ *Folder count*: **304** ++ *Line count*: **289396** ++ *Field count*: **1545** ++ *File count*: **1912** ++ *Folder count*: **310** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 1fc694334..f8d72ec54 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -3309,7 +3309,12 @@ class Get // Load the results as a list of stdClass objects (see later for more options on retrieving data). $view = $this->db->loadObject(); - + // fix alias to use in code + $view->code = $this->uniqueCode( + ComponentbuilderHelper::safeString($view->codename) + ); + $view->Code = ComponentbuilderHelper::safeString($view->code, 'F'); + $view->CODE = ComponentbuilderHelper::safeString($view->code, 'U'); // Trigger Event: jcb_ce_onBeforeModelCustomViewData $this->triggerEvent( 'jcb_ce_onBeforeModelCustomViewData', @@ -3355,12 +3360,6 @@ class Get $this->setDynamicValues(base64_decode($view->default)), $guiMapper ); - // fix alias to use in code - $view->code = $this->uniqueCode( - ComponentbuilderHelper::safeString($view->codename) - ); - $view->Code = ComponentbuilderHelper::safeString($view->code, 'F'); - $view->CODE = ComponentbuilderHelper::safeString($view->code, 'U'); // load context if not set if (!isset($view->context) || !ComponentbuilderHelper::checkString( diff --git a/componentbuilder.xml b/componentbuilder.xml index 8efde3ca5..fcd85f9ee 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 7th December, 2020 + 8th December, 2020 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com