Hi, I think I found a bug, but it seems strange that nobody point it out before, since with it the module can't be used at all.
Anyway, the problem was that I couldn't set up any vocabulary to be used to tag users, because nothing was written in users_tag_vocabulary table from admin/settings/user_tags configuration page.
I looked at user_tags.module and found the following code at the beginning of user_tags_settings function:

  if ($_POST['edit']['user_tags_vocabulary_list']) {
    db_query('DELETE FROM {user_tags_vocabulary}');
    foreach ($_POST['edit']['user_tags_vocabulary_list'] as $vid) {
      db_query("INSERT INTO {user_tags_vocabulary} (vid) VALUES (%d)", $vid);
    }
  } 

I don't know what is the ['edit'] index. Anyway I simply removed it and now everything works.
In other words I replaced the above code with:

  if ($_POST['user_tags_vocabulary_list']) {
    db_query('DELETE FROM {user_tags_vocabulary}');
    foreach ($_POST['user_tags_vocabulary_list'] as $vid) {
      db_query("INSERT INTO {user_tags_vocabulary} (vid) VALUES (%d)", $vid);
    }
  } 

Comments

markDrupal’s picture

Thanks! this fixed the problem I had with this module....

jmiccolis’s picture

This fixed worked for me as well, but when I looked at this I also noticed the same information that is getting stored in the "user_tags_vocabulary" table about what vocabularies you select, is also stored in the drupal variable "user_tags_vocabulary_list". Is there a reason for this? Would using drupal's variable_get() be a better way to handle this information?

flk’s picture

god it would help a lot if i do look at what you guys post for a change lol....anyways updated the module and cleaned up the code.
should be working now...sorry for the late replies.
No rest for the wicked (exams :P)

@jm
i just noticed what you said...hmm maybe using the data info might be more effiecient way of handling the tags, rather than storing them in their own table....will look into it.

flk’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)