1
When I add a notification in booklists 0.8 (books waiting for approval), my whole notification section crashes (white notifications page).
I get the following error message:
Fatal error: Call to a member function on a non-object in
/home/club/public_html/modules/booklists/include/notification.inc.php
on line 37
I took a look at the code, but I can't find anything wrong:
function mybooks_notify_iteminfo($category, $item_id)
{
global $xoopsModule, $xoopsModuleConfig, $xoopsConfig;
if (empty($xoopsModule) || $xoopsModule->getVar('dirname') != 'mybooks') {
$module_handler =& xoops_gethandler('module');
$module =& $module_handler->getByDirname('mybooks');
$config_handler =& xoops_gethandler('config');
$config =& $config_handler->getConfigsByCat(0,$module->getVar('mid'));
} else {
$module =& $xoopsModule;
$config =& $xoopsModuleConfig;
}
//include_once XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/main.php';
if ($category=='global') {
$item['name'] = '';
$item['url'] = '';
return $item;
}
global $xoopsDB;
if ($category=='category') {
// Assume we have a valid category id
$sql = 'SELECT title FROM ' . $xoopsDB->prefix('mybooks_cat') . ' WHERE cid = '.$item_id;
$result = $xoopsDB->query($sql); // TODO: error check
$result_array = $xoopsDB->fetchArray($result);
$item['name'] = $result_array['title'];
$item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/viewcat.php?cid=' . $item_id;
return $item;
}
if ($category=='link') {
// Assume we have a valid link id
$sql = 'SELECT cid,title FROM '.$xoopsDB->prefix('mybooks_links') . ' WHERE lid = ' . $item_id;
$result = $xoopsDB->query($sql); // TODO: error check
$result_array = $xoopsDB->fetchArray($result);
$item['name'] = $result_array['title'];
$item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/singlelink.php?cid=' . $result_array['cid'] . '&lid=' . $item_id;
return $item;
}
}
If I turn off all my booklists notifications off, I get my notifications page back.
Has anyone encountered this in booklists?
Any ideas on how to correct it?
I tried upgrading to booklists 0.9, but then it all crashes. I don't want to uninstall and install again (I don't want to loose my books).