On install of user_tags.module, I received the following error

    * user warning: Unknown column 'tu.vid' in 'where clause' query: user_tags_user SELECT t.* FROM term_data t INNER JOIN term_user tu WHERE tu.tid = t.tid AND tu.vid = t.vid AND tu.uid = 1 ORDER BY weight, name in C:\www\webroot\socialnet\includes\database.mysql.inc on line 120.
    * user warning: Unknown column 'tu.vid' in 'where clause' query: user_tags_user SELECT t.* FROM term_data t INNER JOIN term_user tu WHERE tu.tid = t.tid AND tu.vid = t.vid AND tu.uid = 1 ORDER BY weight, name in C:\www\webroot\socialnet\includes\database.mysql.inc on line 120.

On inspection of the code, I noticed that the term_user table does not have a column named vid. From the user_tags.install file:

CREATE TABLE {term_user} (
                  tid int(10) unsigned NOT NULL default '0',
                  uid int(10) unsigned NOT NULL default '0'
                ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;

I also noticed that on line 53 of user_tags.module, there is a query which will fail because the user_tags_vocabulary table only has one column (vid), and no column named "name":

SELECT vu.vid, v.name FROM {user_tags_vocabulary} vu INNER JOIN {vocabulary} v ON v.vid = vu.vid

The user_tags.install file has the following table decription:

CREATE TABLE {user_tags_vocabulary} (
                  vid INT NOT NULL
                ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;

I will likely patch for myself and resubmit, but I wanted to inform you of the problem as soon as I found it.

Comments

jrc@drupal.org’s picture

Title: Install Problems: Code and Data Model don't match » Scratch second query error

I obviously need to brew some more coffee. That second query from line 53 has no error.

flk’s picture

Title: Scratch second query error » table structure error

sorry i am really trying to get this problem sorted(well i have it ready to be committed)...but i cant seem to be able to commit/login to cvs for some reason....

flk’s picture

Status: Active » Closed (fixed)

wait a minute, i just did a grap from head and 4.7 branch and the install script are ok, the column in question is in the install file

*scratches head*

closing this unless someone else has similar problem