[drupal-devel] [bug] Forum table: vid gone AWOL

Souvent22 drupal-devel at drupal.org
Fri Sep 16 17:58:08 UTC 2005

Issue status update for 
Post a follow up: 

 Project:      Drupal
 Version:      cvs
 Component:    forum.module
 Category:     bug reports
 Priority:     critical
 Assigned to:  Anonymous
 Reported by:  robertDouglass
 Updated by:   Souvent22
-Status:       active
+Status:       patch (code needs review)

Update status; anyone wanna take a look?


Previous comments:

Thu, 15 Sep 2005 21:02:54 +0000 : robertDouglass

The function forum_load consists entirely of this query:
function forum_load($node) {
  $forum = db_fetch_object(db_query('SELECT * FROM {forum} WHERE vid
= %d', $node->vid));
  return $forum;

The forum table, however, has no vid column. What should it be? WHERE
nid = %d ?

I haven't been following the changes to forum.module closely, so I
don't know the rest of the issues involved, but the module doesn't work
as is.


Fri, 16 Sep 2005 17:20:49 +0000 : syllance

There's also en error when simply adding forum topic :

user error: Unknown column 'vid' in 'field list'
query: INSERT INTO forum (nid, vid, tid) VALUES (6, 6, 2) in
/drupal/head/database.mysql.inc on line 99.

Sounds like the removed vid field in forum table is still used in
forum.module queries.

The forum topic node is inserted, but not linked with forum due to this
error, so that's blocking the use of forums.

I've quickly searched but could not find any patch for this. I'll
double check and try to make one if needed.


Fri, 16 Sep 2005 17:55:55 +0000 : Souvent22

Attachment: http://drupal.org/files/issues/ref_error_0.patch (4.64 KB)

Yes, vid should be the second column, just as the query says, INSERT
INTO....(nid, vid,tid)....

Seems you have the code for this, but you havne't updated your database
with update.inc, i'm not sure if there is an update to the forum table
in update.inc.....

Well, nevermind, a quick check shows that in updates.inc, it does alter
your tables for you and fix the problem, however, the current schema in
database.mysql and database.pgsql does *not*. Here's a patch that fixes

So in short, form.module has been updated to use revisions, however,
you're missing a vid field in your table.

More information about the drupal-devel mailing list