Closed (fixed)
Project:
User Tags
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Mar 2007 at 09:51 UTC
Updated:
11 Jun 2007 at 19:50 UTC
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
Comment #1
markDrupal commentedThanks! this fixed the problem I had with this module....
Comment #2
jmiccolis commentedThis 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?
Comment #3
flk commentedgod 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.
Comment #4
flk commentedComment #5
(not verified) commented