As discussed with quicksketch in the IRC that patch changes $flag->default_options to $flag->options().
I've also added the patch for #475366: Flag queue here. If you'd like that separate I can do it.
So next move, as discussed, would be creating a 2.x branch .
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | flag_options_alter.patch | 2.26 KB | quicksketch |
| #2 | flag-branch2-2.patch | 4.49 KB | amitaibu |
| flag-branch2-1.patch | 3.85 KB | amitaibu |
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.