Closed (fixed)
Project:
Project issue tracking
Version:
6.x-1.x-dev
Component:
Issues
Priority:
Normal
Category:
Feature request
Assigned:
Issue tags:
Reporter:
Created:
19 Sep 2011 at 19:07 UTC
Updated:
4 Jan 2014 at 01:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dwwWe want to make sure we're adding the flag as the right user. I guess both hook_comment() and hook_nodeapi() run as the user creating the node and the comment, so we can just rely on global $user for this. But maybe it's safer to explicitly specify?
Anyway, I agree this code should just live in project_issue, conditionally fired based on the flag-specific setting we're adding over at #397458: Revamp mailing logic to leverage flag module (as opposed to trying to get this all working via actions/triggers/rules -- let's just deploy before the dependency chain spirals out of control). ;)
Comment #2
dwwOh right. There's code to do something similar in the patch at #404084-20: Add support for tracking flagged nodes. However, not everyone using project_issue uses tracker2, so it'd still be nice to have this code live in project_issue itself.
Wonder if that code makes sense in #404084 or not. Hrm.
Comment #3
hunmonk commentedit doesn't look to me like it's possible to specify another user when creating a new comment, at least not via the regular UI. outside of programmatically created comments, i can't think of another way this would bite us -- should we bother worrying about this?
Comment #4
dwwisn't "bother worrying about this" adding all of
$comment->uidto the parameters to flag()? ;)Comment #5
hunmonk commentedactually, it would be $arg['uid'] (don't we love comment module), and also we need to load the user account, flag is expecting the whole user object. i guess i can build that into the helper function i'm writing...
Comment #6
dwwif it's a PITA, skip it.
Comment #7
hunmonk commentedfirst crack at this, not tested yet, just posting for code quality feedback.
Comment #8
dwwBasically looks fine. Minor nit:
project_issue_get_follow_flag() already checks for if flag is enabled, so I'd just combine these two lines into a single check:
Otherwise, if it works, I'm happy. ;)
Comment #9
hunmonk commentedcleaned up code per #8
Comment #10
dwwI noticed another simplification. Instead of this:
We just need:
Made that change, then committed and pushed to 34496-flag-integration:
http://drupal.org/commitlog/commit/1894/e7b97d957a2784098b17ba82274ab215...
However, in testing I realized #8 was broken and neither of us tested it. ;) Fixed that and also pushed:
http://drupal.org/commitlog/commit/1894/43887a0b30093f54d7c933588e30b9e7...
Given that this is in the main feature branch now, I'm going to call it fixed. We can wait to mark #34496: [meta] Add Flag module to allow users to subscribe/unsubscribe without posting a comment fixed itself until we merge that into master.
Comment #11
hunmonk commentedreopening to address an implementation concern:
bypassing the auto flag simply based on if tracker2 is installed is not a complete test. it's possible that tracker2 could be installed, but not have its follow flag set or set to a different follow flag. do we care to shore this up or not?
Comment #12
hunmonk commentedhttp://drupal.org/commitlog/commit/1894/0e022780065f0f9e722b538ca69e4d15...