1
Hi all,
Currently, I just upgraded a site from 2.0.7 to 2.2.3. Most of the modules work except the newbb - All the forum disappeared ,and fail to create any new forum by complain "database error".
I found that the database structure was not altered during upgrade. (e.g. the field of parent_forum is not present in bb_forums). I have tried to upgrade the module in the admin page again, but the database structure remains no changes.
In reading the source,I found the following codes in modules/newbb/include/module.php
function xoops_module_pre_update_newbb(&$module)
{
$oldversion = $module->getVar('version');
$oldconfig = $module->getVar('hasconfig');
// NewBB 1.0 -- no config
if (empty($oldconfig)) {
$result = $GLOBALS['xoopsDB']->queryF("CREATE TABLE ".$GLOBALS['xoopsDB']->prefix("bb_archive")."(
`topic_id` tinyint(8) NOT NULL default '0',
`post_id` tinyint(8) NOT NULL default '0',
`post_text` text NOT NULL
) TYPE=MyISAM");
And then followed by a list of functions to alter the database sturcture. I am quite wonder why it need to check is empty of 'hasconfig' before to alter tables?
By modify the if-statement to a alway-truth condition, I finally got a workable newbb2. But this method is quite ugly... do it have any standard way to solve similiar kind of problem?
Thanks