Closed (fixed)
Project:
Flag
Version:
6.x-2.x-dev
Component:
Flag core
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Jul 2009 at 15:00 UTC
Updated:
18 Nov 2010 at 06:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
quicksketchHey Amitaibu, looks pretty good. I'm concerned about this function:
This will not return the complete set of results, since a single piece of content may be flagged multiple times by different users (unless it's a "global" flag). So retrieving a single fcid is a bit misleading. Adding a second $uid parameter might make sense, but default it to NULL in the case that you're checking on a global flag.
Actually now that I think about it more, there's yet another parameter needed here, since the same user might flag both a node with nid "2" and a user with uid "2". So we need to either require a content_type parameter or a flag ID (fid), so that we get a unique result per type (since flags are tied to one type of content, either one will work.
I'm also a bit curious about
flag_get_flag_counts, why would you want to use this rather thanflag_get_counts()or$flag->get_counts(), which does the same thing?Comment #2
amitaibu1) Fixed flag_get_fcid_from_content_id() to return all possible fcid values, and added $fid to the function's signature.
2) I've added static to flag_get_flag_counts() so it will be like flag_get_counts()
flag_get_counts - return all counts for a content ID.
flag_get_flag_counts - return counts for *all* the content IDs in that flag.
Comment #3
quicksketchThis patch seems to contain a variety of changes, but it's a good place to start with the 2.x version. I've added the drupal_alter('flag_options') hook to get started, let's move the API changes back into #475366: Flag queue, since I think these need some further revision.
I've created the 2.x branch with the attached changes.
Comment #4
quicksketchI put all the API changes in #576388: Additional API functions for Flag queue functionality.
Comment #5
quicksketchComment #7
mooffie commentedTagging.