Hi all! I try to load a book into Joomla (vers. 3.4.8 + ABOOK 3.1.0) article with {loadbook id=NNN} plugin code. When I click "Save" button such error
Fatal error: Call to undefined method JApplicationAdministrator::getParams() in Z:\home\localhost\www\gse\components\com_abook\helpers\route.php on line 107
appears. Articles saves, but have been blocked. In site front-end views book appears normally. Any ideas how to fix this code:
//Create the link
$link = 'index.php?option=com_abook&view=author&id='. $id;
$app = JFactory::getApplication('site');
line107 $params = $app->getParams(); //Will rise an error if uncommented
$itemid= $params->get("author_itemid");
if ($itemid!=''){
$link .= '&Itemid='.$itemid;
}elseif ($item = self::_findItem($needles)) {
$link .= '&Itemid='.$item;
}
return $link;
}
Hi to all!
I fixed this problem and more (when user in back-end press cancel in tag add or author add, he has got a blank screen and must refresh page manually)
replace above post code in helpers/route.php by this fragment - all works correctly :)
//Create the link
$link = 'index.php?option=com_abook&view=author&id='. $id;
// $app = JFactory::getApplication();
// $params = $app->getParams('com_component1');
$params = JComponentHelper::getParams('com_content');
$test = $params->get('site');
// $app = JFactory::getApplication('site');
// $params = $app->getParams();
$itemid= $params->get("author_itemid"); //
if ($itemid!=''){
$link .= '&Itemid='.$itemid;
}elseif ($item = self::_findItem($needles)) {
$link .= '&Itemid='.$item;
}
return $link;
}
Hi alex_n,
try to come back to old code and change from
$app = JFactory::getApplication('site');
to
$app = JFactory::getApplication();
It is works?