Posted by moshe weitzman on January 23, 2008 at 10:03pm
| Project: | Views Bookmark |
| Version: | 5.x-1.x-dev |
| Component: | Views integration |
| Category: | bug report |
| Priority: | critical |
| Assigned: | mooffie |
| Status: | closed (fixed) |
Issue Summary
Sadly, I had to disable this module from http://boston2008.drupalcon.org/sessions because of this bug.
This Bookmark: Ops field in Views (see views_bookmark_nodes table definition) shows an arbitrary value because its value is never filtered for the current user. I think the current user should be added to the JOIN with the views_bookmark_nodes table. This should probably happen in the query handler for this field.
I tried to fix this but a bit lost in the query handler. Help moofie!
Comments
#1
Actually, we should probably move the 'Bookmark: Ops for @s' field to a new pseudotable that has an 'extra' clause that adds the JOIN on uid = ***CURRENT_USER***. this will cause the least interference with other filters and arguments.
#2
I'll work on this today.
#3
Oh, nice! Views_bookmark will be perfect for this! :-)
That's correct.
I'm attaching a patch. (You should apply it to the latest CVS. But, you know, don't do this on a live site --I did test it numerous times, but maybe it won't be the final patch.)
I decided to add a new [pseudo] table. I did a lot of thinking about this, and finally came to the conclusion that it's the better and clearer route.
Yes, that's what I did.
That's a by-product, but it actually wasn't my prime rationale.
Notes:
'table' => 'views_bookmark_nodes_$bookmark->vbid'line --note the *single* quotes.)#4
tested and verified to work. i didn't test upgrade path but i think that can be fixed (or ignored - re-adding a field is easy) later. thanks much.
i think moofie deserves commit rights on this module if he/she wants them.
#5
Oh, thanks for the compliment :-)
But I want to prove myself some more before I ask to be a co-maintainer.
BTW, I've just posted a How to setup a "Who's boorkmarked this" tab recipe.
#6
I'm alright with this patch also, just a small concern. Will this adversely affect users that already ran update_5100 to run update_5101?
#7
It's safe to run 5101 multiple times, so it won't adversely affect users who already run 5100.
#8
Fantastic. Committed. Thanks again mooffie!
#9
Automatically closed -- issue fixed for two weeks with no activity.