Sets the code name of custom views before the model even, so it can be used in the event.

This commit is contained in:
Llewellyn van der Merwe 2020-12-08 06:32:39 +02:00
parent 4d0097f8e4
commit a05efdbb33
Signed by: Llewellyn
GPG Key ID: EFC0C720A240551C
4 changed files with 17 additions and 18 deletions

View File

@ -144,14 +144,14 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 7th December, 2020 + *Last Build*: 8th December, 2020
+ *Version*: 2.12.1 + *Version*: 2.12.1
+ *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 - 2020 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*: **288998** + *Line count*: **289396**
+ *Field count*: **1537** + *Field count*: **1545**
+ *File count*: **1902** + *File count*: **1912**
+ *Folder count*: **304** + *Folder count*: **310**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > 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) > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -144,14 +144,14 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 7th December, 2020 + *Last Build*: 8th December, 2020
+ *Version*: 2.12.1 + *Version*: 2.12.1
+ *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 - 2020 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*: **288998** + *Line count*: **289396**
+ *Field count*: **1537** + *Field count*: **1545**
+ *File count*: **1902** + *File count*: **1912**
+ *Folder count*: **304** + *Folder count*: **310**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > 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) > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -3309,7 +3309,12 @@ class Get
// Load the results as a list of stdClass objects (see later for more options on retrieving data). // Load the results as a list of stdClass objects (see later for more options on retrieving data).
$view = $this->db->loadObject(); $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 // Trigger Event: jcb_ce_onBeforeModelCustomViewData
$this->triggerEvent( $this->triggerEvent(
'jcb_ce_onBeforeModelCustomViewData', 'jcb_ce_onBeforeModelCustomViewData',
@ -3355,12 +3360,6 @@ class Get
$this->setDynamicValues(base64_decode($view->default)), $this->setDynamicValues(base64_decode($view->default)),
$guiMapper $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 // load context if not set
if (!isset($view->context) if (!isset($view->context)
|| !ComponentbuilderHelper::checkString( || !ComponentbuilderHelper::checkString(

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade"> <extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name> <name>COM_COMPONENTBUILDER</name>
<creationDate>7th December, 2020</creationDate> <creationDate>8th December, 2020</creationDate>
<author>Llewellyn van der Merwe</author> <author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail> <authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl> <authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>