Closed (fixed)
Project:
Flag
Version:
6.x-1.x-dev
Component:
Flag core
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Aug 2010 at 14:29 UTC
Updated:
7 Sep 2010 at 10:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
quicksketchLooks good to me.
Comment #2
mooffie commentedI just had a look into this function. It has more bugs. I'll investigate this later this week.
Comment #3
mooffie commentedOK, here's the patch.
We have three versions: D61, D62, D7. So three patches (I have one for D5 too).
Wrong slots
The code looks for the cache in the wrong slot, so the cache isn't used (espacially for D62 and D7: so $flag->is_flagged() doesn't use the cahce!).
Documentation mismatch
The other problem is wrong documentation. It states that the return value (when no content id is given) is:
whereas it's actually:
So which version is the intended behaviour? Acording to this historic 'Views Bookmark' commit the documentation is right. But somewehre along the way we inadvertently switched to the second version. (We already have code in 'flag.activity.inc' that accepts this version, so it seems we're bound to stay with it.)
Comment #4
mooffie commentedThe documentation should say "content_id", not "nid"; I'll fix it before I commit.
(Here's the patch for D5 in case I accidentally delete it.)
Comment #5
mooffie commentedThis isn't 'minor'.
The implication of this bug is that $flag->is_flagged(), on Flag-2.x, doesn't use the PHP cache.
Comment #6
mooffie commentedNate, are you fine with this patch? It also fixes a D7 bug ("$account->uid" instead of "$uid").
Don't bother applying and committing my patches: just approve them and I'll do the rest.
I'm glad you aren't webchick as she'd insist on a test (which is a very good thing, especially for this issue, but a single Drupal test takes ages to run (because of the setting up of the DB), and therefore to code).
Comment #7
quicksketchYep, take it away mooffie. Thanks again!
Comment #8
mooffie commentedCommitted.
http://drupal.org/cvs?commit=411358
http://drupal.org/cvs?commit=411360
http://drupal.org/cvs?commit=411356
http://drupal.org/cvs?commit=411354