I get this error and is affecting my modules from working properly. I am not sure how to fix it. Most of the help sites said that they got the error after they upgraded but since I did not upgrade I am not sure why I got this error.
Error Message: Warning: Creating default object from empty value in ..../aac/administrator/components/com_poweradmin/helpers/history.php on line 125.
The below starts from line 116 to 154.
Line 125: "$listPage->params = (isset($listPage->params)) ? str_replace('&', '&', $listPage->params) : '';"
Codes used:
private static function updateHistoryState($post)
{
if (!isset($_COOKIE['jsn-poweradmin-list-page']))
return;
$listPage = json_decode($_COOKIE['jsn-poweradmin-list-page']);
if ($listPage == NULL)
$listPage = json_decode(stripslashes($_COOKIE['jsn-poweradmin-list-page']));
$listPage->params = (isset($listPage->params)) ? str_replace('&', '&', $listPage->params) : '';
$id = array();
if (isset($post['id']) && is_numeric($post['id']))
$id[] = $post['id'];
else if (isset($post['id']) && is_array($post['id']))
$id = array_merge($id, $post['id']);
if (isset($post['cid']) && is_numeric($post['cid']))
$id[] = $post['cid'];
else if (isset($post['cid']) && is_array($post['cid']))
$id = array_merge($id, $post['cid']);
$isDelete = (int)preg_match('/\.?(delete|remove|trash)$/i', $post['task']);
if (count ($id) && (is_numeric($id) || is_array($id))) {
// Bypass if any of id list is not a number
if (is_array($id)) {
foreach ($id as $i) {
if (!is_numeric($i)) {
return;
}
}
}
$dbo = JFactory::getDBO();
$dbo->setQuery("UPDATE #__jsn_poweradmin_history SET is_deleted={$isDelete} WHERE list_page_params LIKE '{$listPage->params}' AND object_id IN (".implode(',', $id).")");
@$dbo->query();
}
}