Deleting an "add to favorite" for one user deletes all the entries.
To reproduce do the following
1 - vanilla drupal install
2 - install favorite_nodes module
3 - create a page "page1" "body of page1"
4 - create users "user1", "user2"
5 - sign in as user1
6 - goto "page1"
7 - "add to favorite"
8 - logout and login again as user2
9 - repeat steps 6 and 7.
10 - logout from user2 and login again as user1
11 - goto my account , favorite page
12 - there's an entry for page1 - delete it.
13 - same as step 8.
14 - goto my account -> favorite page and notice there are no favorite pages for user2.
therefore when user1 deleted page1 from it's favorite nodes it also deleted it for user2 which imho is a bug.
thanks.
yashesh bhatia.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | favorite_nodes_0.patch | 463 bytes | sun |
| #2 | file.patch_1.txt | 465 bytes | yasheshb |
| #1 | favorite_nodes.module | 5.15 KB | yasheshb |
Comments
Comment #1
yasheshb commentedfixed it.
[yvb@sun favorite_nodes]# diff favorite_nodes.module favorite_nodes.module.org
167,168c167
< global $user;
< db_query("DELETE FROM {favorite_nodes} WHERE nid = %d AND uid=%d", $nid, $user->uid);
---
> db_query("DELETE FROM {favorite_nodes} WHERE nid = %d", $nid);
[yvb@sun favorite_nodes]#
how do i add a patch to the module ?
thanks.
yashesh bhatia.
Comment #2
yasheshb commentedhere's the patch file.
yashesh bhatia.
Comment #3
sunBetter patch. Please adhere to Drupal coding standards.