Setting Add Uikit to No breaks frontend view #163

Closed
opened 2017-11-03 15:58:31 +00:00 by kevincam3 · 26 comments
kevincam3 commented 2017-11-03 15:58:31 +00:00 (Migrated from github.com)

It looks like the view by default tries to load the Uikit even if you set it to no in Libs & Helpers of the component

It looks like the view by default tries to load the Uikit even if you set it to no in Libs & Helpers of the component

I have not found this to be true, but will have a look at it, you can check the code in the view.html.php

/**
 * Prepares the document
 */
protected function _prepareDocument()
{

	// always make sure jquery is loaded.
	JHtml::_('jquery.framework');
	// Load the header checker class.
	require_once( JPATH_COMPONENT_SITE.'/helpers/headercheck.php' );
	// Initialize the header checker.
	$HeaderCheck = new sermondistributorHeaderCheck;

	// Load uikit options.
	$uikit = $this->params->get('uikit_load');
	// Set script size.
	$size = $this->params->get('uikit_min');
	// Set css style.
	$style = $this->params->get('uikit_style');

	// The uikit css.
	if ((!$HeaderCheck->css_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3)
	{
		$this->document->addStyleSheet(JURI::root(true) .'/media/com_sermondistributor/uikit/css/uikit'.$style.$size.'.css');
	}
	// The uikit js.
	if ((!$HeaderCheck->js_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3)
	{
		$this->document->addScript(JURI::root(true) .'/media/com_sermondistributor/uikit/js/uikit'.$size.'.js');
	}

	// Load the script to find all uikit components needed.
	if ($uikit != 2)
	{
		// Set the default uikit components in this view.
		$uikitComp = array();
		$uikitComp[] = 'data-uk-grid';

		// Get field uikit components needed in this view.
		$uikitFieldComp = $this->get('UikitComp');
		if (isset($uikitFieldComp) && SermondistributorHelper::checkArray($uikitFieldComp))
		{
			if (isset($uikitComp) && SermondistributorHelper::checkArray($uikitComp))
			{
				$uikitComp = array_merge($uikitComp, $uikitFieldComp);
				$uikitComp = array_unique($uikitComp);
			}
			else
			{
				$uikitComp = $uikitFieldComp;
			}
		}
	}

	// Load the needed uikit components in this view.
	if ($uikit != 2 && isset($uikitComp) && SermondistributorHelper::checkArray($uikitComp))
	{
		// load just in case.
		jimport('joomla.filesystem.file');
		// loading...
		foreach ($uikitComp as $class)
		{
			foreach (SermondistributorHelper::$uk_components[$class] as $name)
			{
				// check if the CSS file exists.
				if (JFile::exists(JPATH_ROOT.'/media/com_sermondistributor/uikit/css/components/'.$name.$style.$size.'.css'))
				{
					// load the css.
					$this->document->addStyleSheet(JURI::root(true) .'/media/com_sermondistributor/uikit/css/components/'.$name.$style.$size.'.css');
				}
				// check if the JavaScript file exists.
				if (JFile::exists(JPATH_ROOT.'/media/com_sermondistributor/uikit/js/components/'.$name.$size.'.js'))
				{
					// load the js.
					$this->document->addScript(JURI::root(true) .'/media/com_sermondistributor/uikit/js/components/'.$name.$size.'.js', 'text/javascript', true);
				}
			}
		}
	}  

	// Add the CSS for Footable.
	$this->document->addStyleSheet(JURI::root() .'media/com_sermondistributor/footable/css/footable.core.min.css');

	// Use the Metro Style
	if (!isset($this->fooTableStyle) || 0 == $this->fooTableStyle)
	{
		$this->document->addStyleSheet(JURI::root() .'media/com_sermondistributor/footable/css/footable.metro.min.css');
	}
	// Use the Legacy Style.
	elseif (isset($this->fooTableStyle) && 1 == $this->fooTableStyle)
	{
		$this->document->addStyleSheet(JURI::root() .'media/com_sermondistributor/footable/css/footable.standalone.min.css');
	}

	// Add the JavaScript for Footable
	$this->document->addScript(JURI::root() .'media/com_sermondistributor/footable/js/footable.js');
	$this->document->addScript(JURI::root() .'media/com_sermondistributor/footable/js/footable.sort.js');
	$this->document->addScript(JURI::root() .'media/com_sermondistributor/footable/js/footable.filter.js');
	$this->document->addScript(JURI::root() .'media/com_sermondistributor/footable/js/footable.paginate.js'); 
	// load the meta description
	if (isset($this->series->metadesc) && $this->series->metadesc)
	{
		$this->document->setDescription($this->series->metadesc);
	}
	elseif ($this->params->get('menu-meta_description'))
	{
		$this->document->setDescription($this->params->get('menu-meta_description'));
	}
	// load the key words if set
	if (isset($this->series->metakey) && $this->series->metakey)
	{
		$this->document->setMetadata('keywords', $this->series->metakey);
	}
	elseif ($this->params->get('menu-meta_keywords'))
	{
		$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
	}
	// check the robot params
	if (isset($this->series->robots) && $this->series->robots)
	{
		$this->document->setMetadata('robots', $this->series->robots);
	}
	elseif ($this->params->get('robots'))
	{
		$this->document->setMetadata('robots', $this->params->get('robots'));
	}
	// check if autor is to be set
	if (isset($this->series->created_by) && $this->params->get('MetaAuthor') == '1')
	{
		$this->document->setMetaData('author', $this->series->created_by);
	}
	// check if metadata is available
	if (isset($this->series->metadata) && $this->series->metadata)
	{
		$mdata = json_decode($this->series->metadata,true);
		foreach ($mdata as $k => $v)
		{
			if ($v)
			{
				$this->document->setMetadata($k, $v);
			}
		}
	} 
	// add the document default css file
	$this->document->addStyleSheet(JURI::root(true) .'/components/com_sermondistributor/assets/css/series.css'); 
}

Here is the XML of those switches

<fieldset
	name="uikit_config"
	label="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_LABEL"
	description="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_DESC">
	<field name="uikit_load"
		type="radio"
		label="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_LOAD_LABEL"
		description="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_LOAD_DESC"
		class="btn-group btn-group-yesno"
		default="">
		<!-- Option Set. -->
		<option value="">
			COM_SERMONDISTRIBUTOR_CONFIG_AUTO_LOAD</option>"
		<option value="1">
			COM_SERMONDISTRIBUTOR_CONFIG_FORCE_LOAD</option>"
		<option value="3">
			COM_SERMONDISTRIBUTOR_CONFIG_ONLY_EXTRA</option>"
		<option value="2">
			COM_SERMONDISTRIBUTOR_CONFIG_DONT_LOAD</option>"
	</field>
	<field name="uikit_min"
		type="radio"
		label="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_MIN_LABEL"
		description="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_MIN_DESC"
		class="btn-group btn-group-yesno"
		default="">
		<!-- Option Set. -->
		<option value="">
			COM_SERMONDISTRIBUTOR_CONFIG_NO</option>"
		<option value=".min">
			COM_SERMONDISTRIBUTOR_CONFIG_YES</option>"
	</field>
	<field name="uikit_style"
		type="radio"
		label="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_STYLE_LABEL"
		description="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_STYLE_DESC"
		class="btn-group btn-group-yesno"
		default="">
		<!-- Option Set. -->
		<option value="">
			COM_SERMONDISTRIBUTOR_CONFIG_FLAT_LOAD</option>"
		<option value=".almost-flat">
			COM_SERMONDISTRIBUTOR_CONFIG_ALMOST_FLAT_LOAD</option>"
		<option value=".gradient">
			COM_SERMONDISTRIBUTOR_CONFIG_GRADIANT_LOAD</option>"
	</field>
</fieldset>

So you can see that uikit_load -> 2 = do not load and in the code 2 stops any of those codes to load. This means if it still loads after turning it off, it could be your browser memory.

I have not found this to be true, but will have a look at it, you can check the code in the view.html.php ``` /** * Prepares the document */ protected function _prepareDocument() { // always make sure jquery is loaded. JHtml::_('jquery.framework'); // Load the header checker class. require_once( JPATH_COMPONENT_SITE.'/helpers/headercheck.php' ); // Initialize the header checker. $HeaderCheck = new sermondistributorHeaderCheck; // Load uikit options. $uikit = $this->params->get('uikit_load'); // Set script size. $size = $this->params->get('uikit_min'); // Set css style. $style = $this->params->get('uikit_style'); // The uikit css. if ((!$HeaderCheck->css_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3) { $this->document->addStyleSheet(JURI::root(true) .'/media/com_sermondistributor/uikit/css/uikit'.$style.$size.'.css'); } // The uikit js. if ((!$HeaderCheck->js_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3) { $this->document->addScript(JURI::root(true) .'/media/com_sermondistributor/uikit/js/uikit'.$size.'.js'); } // Load the script to find all uikit components needed. if ($uikit != 2) { // Set the default uikit components in this view. $uikitComp = array(); $uikitComp[] = 'data-uk-grid'; // Get field uikit components needed in this view. $uikitFieldComp = $this->get('UikitComp'); if (isset($uikitFieldComp) && SermondistributorHelper::checkArray($uikitFieldComp)) { if (isset($uikitComp) && SermondistributorHelper::checkArray($uikitComp)) { $uikitComp = array_merge($uikitComp, $uikitFieldComp); $uikitComp = array_unique($uikitComp); } else { $uikitComp = $uikitFieldComp; } } } // Load the needed uikit components in this view. if ($uikit != 2 && isset($uikitComp) && SermondistributorHelper::checkArray($uikitComp)) { // load just in case. jimport('joomla.filesystem.file'); // loading... foreach ($uikitComp as $class) { foreach (SermondistributorHelper::$uk_components[$class] as $name) { // check if the CSS file exists. if (JFile::exists(JPATH_ROOT.'/media/com_sermondistributor/uikit/css/components/'.$name.$style.$size.'.css')) { // load the css. $this->document->addStyleSheet(JURI::root(true) .'/media/com_sermondistributor/uikit/css/components/'.$name.$style.$size.'.css'); } // check if the JavaScript file exists. if (JFile::exists(JPATH_ROOT.'/media/com_sermondistributor/uikit/js/components/'.$name.$size.'.js')) { // load the js. $this->document->addScript(JURI::root(true) .'/media/com_sermondistributor/uikit/js/components/'.$name.$size.'.js', 'text/javascript', true); } } } } // Add the CSS for Footable. $this->document->addStyleSheet(JURI::root() .'media/com_sermondistributor/footable/css/footable.core.min.css'); // Use the Metro Style if (!isset($this->fooTableStyle) || 0 == $this->fooTableStyle) { $this->document->addStyleSheet(JURI::root() .'media/com_sermondistributor/footable/css/footable.metro.min.css'); } // Use the Legacy Style. elseif (isset($this->fooTableStyle) && 1 == $this->fooTableStyle) { $this->document->addStyleSheet(JURI::root() .'media/com_sermondistributor/footable/css/footable.standalone.min.css'); } // Add the JavaScript for Footable $this->document->addScript(JURI::root() .'media/com_sermondistributor/footable/js/footable.js'); $this->document->addScript(JURI::root() .'media/com_sermondistributor/footable/js/footable.sort.js'); $this->document->addScript(JURI::root() .'media/com_sermondistributor/footable/js/footable.filter.js'); $this->document->addScript(JURI::root() .'media/com_sermondistributor/footable/js/footable.paginate.js'); // load the meta description if (isset($this->series->metadesc) && $this->series->metadesc) { $this->document->setDescription($this->series->metadesc); } elseif ($this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } // load the key words if set if (isset($this->series->metakey) && $this->series->metakey) { $this->document->setMetadata('keywords', $this->series->metakey); } elseif ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } // check the robot params if (isset($this->series->robots) && $this->series->robots) { $this->document->setMetadata('robots', $this->series->robots); } elseif ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } // check if autor is to be set if (isset($this->series->created_by) && $this->params->get('MetaAuthor') == '1') { $this->document->setMetaData('author', $this->series->created_by); } // check if metadata is available if (isset($this->series->metadata) && $this->series->metadata) { $mdata = json_decode($this->series->metadata,true); foreach ($mdata as $k => $v) { if ($v) { $this->document->setMetadata($k, $v); } } } // add the document default css file $this->document->addStyleSheet(JURI::root(true) .'/components/com_sermondistributor/assets/css/series.css'); } ``` Here is the XML of those switches ``` <fieldset name="uikit_config" label="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_LABEL" description="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_DESC"> <field name="uikit_load" type="radio" label="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_LOAD_LABEL" description="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_LOAD_DESC" class="btn-group btn-group-yesno" default=""> <!-- Option Set. --> <option value=""> COM_SERMONDISTRIBUTOR_CONFIG_AUTO_LOAD</option>" <option value="1"> COM_SERMONDISTRIBUTOR_CONFIG_FORCE_LOAD</option>" <option value="3"> COM_SERMONDISTRIBUTOR_CONFIG_ONLY_EXTRA</option>" <option value="2"> COM_SERMONDISTRIBUTOR_CONFIG_DONT_LOAD</option>" </field> <field name="uikit_min" type="radio" label="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_MIN_LABEL" description="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_MIN_DESC" class="btn-group btn-group-yesno" default=""> <!-- Option Set. --> <option value=""> COM_SERMONDISTRIBUTOR_CONFIG_NO</option>" <option value=".min"> COM_SERMONDISTRIBUTOR_CONFIG_YES</option>" </field> <field name="uikit_style" type="radio" label="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_STYLE_LABEL" description="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_STYLE_DESC" class="btn-group btn-group-yesno" default=""> <!-- Option Set. --> <option value=""> COM_SERMONDISTRIBUTOR_CONFIG_FLAT_LOAD</option>" <option value=".almost-flat"> COM_SERMONDISTRIBUTOR_CONFIG_ALMOST_FLAT_LOAD</option>" <option value=".gradient"> COM_SERMONDISTRIBUTOR_CONFIG_GRADIANT_LOAD</option>" </field> </fieldset> ``` So you can see that `uikit_load` -> 2 = do not load and in the code 2 stops any of those codes to load. This means if it still loads after turning it off, it could be your browser memory.
kevincam3 commented 2017-11-03 22:01:39 +00:00 (Migrated from github.com)

While debugging I saw that it broke because of this line in the generated model. I had to comment it out for the code to run without the uikit

// Checking if player_evaluation has uikit components that must be loaded. $this->uikitComp = RcsrankingsHelper::getUikitComp($data->player_evaluation,$this->uikitComp);

While debugging I saw that it broke because of this line in the generated model. I had to comment it out for the code to run without the uikit `// Checking if player_evaluation has uikit components that must be loaded. $this->uikitComp = RcsrankingsHelper::getUikitComp($data->player_evaluation,$this->uikitComp);`
kevincam3 commented 2017-11-03 22:03:18 +00:00 (Migrated from github.com)

I think maybe an if here to perform a check first before trying to load it.

I think maybe an if here to perform a check first before trying to load it.

Hmmm this can not be the issue. I know that line in the model triggers the loading of the class names if it finds any in the content. IT places those class names in $this->uikitComp but the view only acts on that array if $uikit is not 2. So even if that method getUikitComp() in the model finds UIKIT classes in your code it will not load UIKIT.

So something does not make sense.... here is the helper method

/**
* 	Get UIKIT Components
**/
public static function getUikitComp($content,$classes = array())
{
	if (strpos($content,'class="uk-') !== false)
	{
		// reset
		$temp = array();
		foreach (self::$uk_components as $looking => $add)
		{
			if (strpos($content,$looking) !== false)
			{
				$temp[] = $looking;
			}
		}
		// make sure uikit is loaded to config
		if (strpos($content,'class="uk-') !== false)
		{
			self::$uikit = true;
		}
		// sorter
		if (self::checkArray($temp))
		{
			// merger
			if (self::checkArray($classes))
			{
				$newTemp = array_merge($temp,$classes);
				$temp = array_unique($newTemp);
			}
			return $temp;
		}
	}	
	if (self::checkArray($classes))
	{
		return $classes;
	}
	return false;
} 

As you can see it does not load any files to the header of the document. It simply looks for UIKIT strings and then if found adds it to the array, so to dynamically add those components to the page. It can not load Uikit unless $uikit is not 2

I mean look here in the view at the following code

// Get field uikit components needed in this view.
$uikitFieldComp = $this->get('UikitComp');

This is when it loads the result from the getUikitComp() method into the view, and as you can see it is after the if statement that checks that $uikit is not 2

Hmmm this can not be the issue. I know that line in the model triggers the loading of the class names if it finds any in the content. IT places those class names in `$this->uikitComp` but the view only acts on that array if `$uikit` is not 2. So even if that method `getUikitComp()` in the model finds UIKIT classes in your code it will not load UIKIT. So something does not make sense.... here is the helper method ``` /** * Get UIKIT Components **/ public static function getUikitComp($content,$classes = array()) { if (strpos($content,'class="uk-') !== false) { // reset $temp = array(); foreach (self::$uk_components as $looking => $add) { if (strpos($content,$looking) !== false) { $temp[] = $looking; } } // make sure uikit is loaded to config if (strpos($content,'class="uk-') !== false) { self::$uikit = true; } // sorter if (self::checkArray($temp)) { // merger if (self::checkArray($classes)) { $newTemp = array_merge($temp,$classes); $temp = array_unique($newTemp); } return $temp; } } if (self::checkArray($classes)) { return $classes; } return false; } ``` As you can see it does not load any files to the header of the document. It simply looks for UIKIT strings and then if found adds it to the array, so to dynamically add those components to the page. It can not load Uikit unless `$uikit` is not 2 I mean look here in the view at the following code ``` // Get field uikit components needed in this view. $uikitFieldComp = $this->get('UikitComp'); ``` This is when it loads the result from the `getUikitComp()` method into the view, and as you can see it is after the if statement that checks that `$uikit` is not 2
kevincam3 commented 2017-11-03 22:26:33 +00:00 (Migrated from github.com)

Ok,

I'll unload it and see if it still does it and if so I'll step into that function and see what inside there is the bad guy and let you know what I find.

Ok, I'll unload it and see if it still does it and if so I'll step into that function and see what inside there is the bad guy and let you know what I find.

So if you in the _prepareDocument() do a var_dump($uikit) what do you get?

If it is 2 then go into the if statements, and do a jexit(); and see if it actually enters the statement.

I am sure you will see that it does not if the $uikit is 2

So if you in the `_prepareDocument()` do a `var_dump($uikit)` what do you get? If it is 2 then go into the if statements, and do a `jexit();` and see if it actually enters the statement. I am sure you will see that it does not if the `$uikit` is 2
kevincam3 commented 2017-11-03 22:30:02 +00:00 (Migrated from github.com)

Yeah, PhpStorm won't even step into it, it goes straight to save the session and close.

Yeah, PhpStorm won't even step into it, it goes straight to save the session and close.
kevincam3 commented 2017-11-03 22:32:41 +00:00 (Migrated from github.com)

So here's the feedback from the IDE:

image

So here's the feedback from the IDE: ![image](https://user-images.githubusercontent.com/870934/32398379-2163b77a-c0d6-11e7-8c84-a0af041a32bd.png)

The fact that your IDE does not find the method does not mean it is not on the page. It is on the page because the helper class is being loaded and it is default to all helper classes build by JCB. So you can check this.

Open the helper class /site/components/com_rcsrankings/helpers/rcsrankingshelper.php do a search in the file for the method getUikitComp you will find the method there.

Then in the main site file of the component /site/components/com_rcsrankings/rcsrankings.php
You will see the following lines

// Require helper files
JLoader::register('RcsrankingsHelper', dirname(__FILE__) . '/helpers/rcsrankingshelper.php'); 

File added via the Joomla JLoader are not picked up by most IDE's so you can not use the IDE to test your code, you must run Joomla and debug in the browser most of the time.

The fact that your IDE does not find the method does not mean it is not on the page. It is on the page because the helper class is being loaded and it is default to all helper classes build by JCB. So you can check this. Open the helper class ` /site/components/com_rcsrankings/helpers/rcsrankingshelper.php` do a search in the file for the method `getUikitComp` you will find the method there. Then in the main site file of the component `/site/components/com_rcsrankings/rcsrankings.php` You will see the following lines ``` // Require helper files JLoader::register('RcsrankingsHelper', dirname(__FILE__) . '/helpers/rcsrankingshelper.php'); ``` File added via the Joomla JLoader are not picked up by most IDE's so you can not use the IDE to test your code, you must run Joomla and debug in the browser most of the time.

Netbeans is far better at this (seeing that classes are on the page) then any of the jetbrains IDEs... I have the full suite of jetbrains IDE's and yet hardly ever use them, Netbeans does what they do per IDE all in one, so I can code BASH, c++, JAVA and PHP and many more at the same time in NETBEANS, give it a try ;) and it is free...

Netbeans is far better at this (seeing that classes are on the page) then any of the jetbrains IDEs... I have the full suite of jetbrains IDE's and yet hardly ever use them, Netbeans does what they do per IDE all in one, so I can code BASH, c++, JAVA and PHP and many more at the same time in NETBEANS, give it a try ;) and it is free...
kevincam3 commented 2017-11-03 22:58:03 +00:00 (Migrated from github.com)

I checked and that method is no where in the component's folder

I checked and that method is no where in the component's folder
kevincam3 commented 2017-11-03 22:59:11 +00:00 (Migrated from github.com)

It only exists when I choose to add the Uikit.

It only exists when I choose to add the Uikit.

Are you telling me that the helper class is not in the helper folder?

Are you telling me that the helper class is not in the helper folder?

Okay you don't understand how things work it seems.

Okay you don't understand how things work it seems.
kevincam3 commented 2017-11-03 23:00:33 +00:00 (Migrated from github.com)

Here's the helper file
image

Here's the helper file ![image](https://user-images.githubusercontent.com/870934/32399007-f8867c58-c0d9-11e7-8af8-d9948261bec4.png)
kevincam3 commented 2017-11-03 23:01:24 +00:00 (Migrated from github.com)

I'm just saying that method is not in my helper class

I'm just saying that method is not in my helper class

Okay maybe I don't understand what you are doing. What do you mean with

It only exists when I choose to add the Uikit.

Because of course it will only be added if you add UIKIT to your component. And if you do not then the code from your model that uses that method will also not be added. They are controlled by the same switch.

Okay maybe I don't understand what you are doing. What do you mean with > It only exists when I choose to add the Uikit. Because of course it will only be added if you add UIKIT to your component. And if you do not then the code from your model that uses that method will also not be added. They are controlled by the same switch.
kevincam3 commented 2017-11-03 23:04:16 +00:00 (Migrated from github.com)

That's the problem, the code that calls it is in my model. But the method is not.

That's the problem, the code that calls it is in my model. But the method is not.
kevincam3 commented 2017-11-03 23:06:47 +00:00 (Migrated from github.com)

Sorry if I don't understand how things work.

Sorry if I don't understand how things work.
kevincam3 commented 2017-11-03 23:07:25 +00:00 (Migrated from github.com)

I'll just keep installing the Uikit to avoid the problem.

I'll just keep installing the Uikit to avoid the problem.

I am not talking about JCB, but PHP :) it seemed for a moment that you don't understand PHP. But okay my bad... lets putt it this way.

I am not talking about JCB, but PHP :) it seemed for a moment that you don't understand PHP. But okay my bad... lets putt it this way.

This is possibly an error on your part. I can not fix what I can not see.

The reality is I can spend another hour showing you that what you are saying can not be true... but man I do not have time to do that now.

But know that the compiler has one global switch for the UIKIT to be added, and that switch is what triggers the method to be added and also that the check in the model be added. I can take a look at this again... I can also point you into the direction of the code if you are willing.

This is possibly an error on your part. I can not fix what I can not see. The reality is I can spend another hour showing you that what you are saying can not be true... but man I do not have time to do that now. But know that the compiler has one global switch for the UIKIT to be added, and that switch is what triggers the method to be added and also that the check in the model be added. I can take a look at this again... I can also point you into the direction of the code if you are willing.
kevincam3 commented 2017-11-03 23:10:57 +00:00 (Migrated from github.com)

Sure, point me to the code, I'm willing

Sure, point me to the code, I'm willing
kevincam3 commented 2017-11-03 23:29:33 +00:00 (Migrated from github.com)

So I found where the compiler is adding it to my model and it appears to be adding it because I'm using the field type of "editor" which is named "player_evaluation" does that help maybe.
image

So I found where the compiler is adding it to my model and it appears to be adding it because I'm using the field type of "editor" which is named "player_evaluation" does that help maybe. ![image](https://user-images.githubusercontent.com/870934/32399503-a203ada2-c0dd-11e7-8583-4f663d12917b.png)

We have one over sized file e_Interpretation.php in the compiler that has to re-factored at some point. I already started doing this, and that is why there is now 6 files that work as one called the compiler.

So the interpretation of the JCB switches and tweaks are all happening in that file at this point.

So there is a class variable called $this->uikit if you search in the interpretation you will find this variable is used all over the place. You will see this variable gets set in the get file of the compiler. Following this variable will take you to all the place, or almost all the places that are linked to the UIKIT.

The method that adds the function is found on line 2270 of the interpreter.
The method that adds the check in the model is done over a few places working together. since some views have fields that is seen as content fields that could be using UIKIT styles.

So to follow the logic take a little more research... good place to start your research will be line 2755 in the interpreter, then try to follow the logic back... I mean try to see how $this->siteFieldData array is build in the fields file of the compiler.

You will see on line 1270 of the fields file it loads the array. Hmmm I think I found it... lets add the global checker in here and see if it resolves your issue.

Sorry man.. hope you understand that trailing... I mean pointing you to the code... this helped me see things that I do not always remember. But okay, I don't mind acknowledging that I might have been wrong in thinking it can't happen.

So here is what you can try... on line 1270 add the following.

if ($this->uikit && in_array($type,$uikit))

Let me know.

If it still does not resolve the issue... then I will look at it next week.

We have one over sized file [e_Interpretation.php](https://github.com/vdm-io/Joomla-Component-Builder/blob/master/admin/helpers/compiler/e_Interpretation.php) in the compiler that has to re-factored at some point. I already started doing this, and that is why there is now 6 files that work as one called the compiler. So the interpretation of the JCB switches and tweaks are all happening in that file at this point. So there is a class variable called `$this->uikit` if you search in the interpretation you will find this variable is used all over the place. You will see this variable gets set in the [get](https://github.com/vdm-io/Joomla-Component-Builder/blob/master/admin/helpers/compiler/a_Get.php#L726) file of the compiler. Following this variable will take you to all the place, or almost all the places that are linked to the UIKIT. The method that adds the function is found on line [2270](https://github.com/vdm-io/Joomla-Component-Builder/blob/master/admin/helpers/compiler/e_Interpretation.php#L2270) of the interpreter. The method that adds the check in the model is done over a few places working together. since some views have fields that is seen as __content__ fields that could be using UIKIT styles. So to follow the logic take a little more research... good place to start your research will be line [2755](https://github.com/vdm-io/Joomla-Component-Builder/blob/master/admin/helpers/compiler/e_Interpretation.php#L2755) in the interpreter, then try to follow the logic back... I mean try to see how `$this->siteFieldData` array is build in the [fields file](https://github.com/vdm-io/Joomla-Component-Builder/blob/master/admin/helpers/compiler/c_Fields.php) of the compiler. You will see on line [1270](https://github.com/vdm-io/Joomla-Component-Builder/blob/master/admin/helpers/compiler/c_Fields.php#L1270) of the fields file it loads the array. Hmmm I think I found it... lets add the global checker in here and see if it resolves your issue. Sorry man.. hope you understand that trailing... I mean pointing you to the code... this helped me see things that I do not always remember. But okay, I don't mind acknowledging that I might have been wrong in thinking it can't happen. So here is what you can try... on line [1270](https://github.com/vdm-io/Joomla-Component-Builder/blob/master/admin/helpers/compiler/c_Fields.php#L1270) add the following. ``` if ($this->uikit && in_array($type,$uikit)) ``` Let me know. If it still does not resolve the issue... then I will look at it next week.
kevincam3 commented 2017-11-03 23:50:49 +00:00 (Migrated from github.com)

Yes, adding the line you suggested solved the problem.
Thanks and sorry for all the back and forward.

Yes, adding the line you suggested solved the problem. Thanks and sorry for all the back and forward.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#163
No description provided.