The code at the end of helpers/utilities.php looks like this:
function getParams($option){
if(K2_JVERSION == '16'){
$app = JFactory::getApplication('site');
var_dump($app);
$params = & $app->getParams($option);
}
else {
$params = &JComponentHelper::getParams($option);
}
return $params;
}
When this code is executed under normal circumstances, the var_dump shows that the object is JSite.
What I'm doing is trying to get another component working with K2 v1.5.3 and Joomla 1.7. It has the following code:
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'models'.DS.'itemlist.php');
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'utilities.php');
$rows = K2ModelItemlist::getData();
The getData() calls getParams(), and I get this error: Call to undefined method JAdministrator::getParams()
The var_dump now shows that the object is JAdministrator instead of JSite.
Based on some extensive research, it looks like the "site" parameter in the getApplication() is having no effect at all. Can somebody tell me how to get this working?
function getParams($option){
if(K2_JVERSION == '16'){
$app = JFactory::getApplication('site');
var_dump($app);
$params = & $app->getParams($option);
}
else {
$params = &JComponentHelper::getParams($option);
}
return $params;
}
When this code is executed under normal circumstances, the var_dump shows that the object is JSite.
What I'm doing is trying to get another component working with K2 v1.5.3 and Joomla 1.7. It has the following code:
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'models'.DS.'itemlist.php');
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'utilities.php');
$rows = K2ModelItemlist::getData();
The getData() calls getParams(), and I get this error: Call to undefined method JAdministrator::getParams()
The var_dump now shows that the object is JAdministrator instead of JSite.
Based on some extensive research, it looks like the "site" parameter in the getApplication() is having no effect at all. Can somebody tell me how to get this working?