1
benlau
[newbb] Database structure was not altered by upgrade from 1.0 to 2.2
  • 2005/12/14 3:40

  • benlau

  • Just popping in

  • Posts: 29

  • Since: 2004/3/7 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

2
davidthomas1
Re: [newbb] Database structure was not altered by upgrade from 1.0 to 2.2

I thought there was an upgrade script in the file package to run...
みんなちがってみんないい。

XOOPS 2.0.13.2

Login

Who's Online

259 user(s) are online (156 user(s) are browsing Support Forums)


Members: 0


Guests: 259


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits