Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Flag has dropped the Activity support.
I have converted it to a patch and I'm attaching it here.
Comment | File | Size | Author |
---|---|---|---|
#17 | 1037718-flag-integration-17.patch | 10.54 KB | katbailey |
#16 | 1037718-flag-integration-16.patch | 10.31 KB | katbailey |
#15 | 1037718-flag-integration-15.patch | 10.32 KB | katbailey |
#14 | 1037718-flag-integration-14.patch | 10.33 KB | katbailey |
#13 | 1037718-flag-integration-13.patch | 11.09 KB | katbailey |
Comments
Comment #1
mooffie CreditAttribution: mooffie commentedThe code was taken straight from Flag (except the new "$info = _activity_activity_info()" line). I'm marking this "needs review" (though I myself won't be able to work on this: I'm not familiar with Activity).
Comment #2
jcmarco CreditAttribution: jcmarco commentedTested and it works fine.
It doesn't require any change in the existing settings.
Comment #3
pribeh CreditAttribution: pribeh commentedsubscribing.
Comment #4
NathanM CreditAttribution: NathanM commentedsubscribing
Comment #5
mazdakaps CreditAttribution: mazdakaps commentedsubscribing
Comment #6
katbailey CreditAttribution: katbailey commentedNot sure if I should have opened a separate issue but here's a start at a D7 patch...
Comment #7
katbailey CreditAttribution: katbailey commentedThis version of the patch fixes tokenization and allows the patch to be used by drush make (i.e. rolled with --no-prefix).
Comment #8
katbailey CreditAttribution: katbailey commentedThis patch has just one extra line over the previous one: explicity declaring $realms as an empty array in flag_activity_api() in activity.contrib.module - this was causing my unit test to crap out...
Comment #9
katbailey CreditAttribution: katbailey commentedIt's amazing the things you find when you try running a few simple tests... here's another fix for the patch (there was a bad query that crapped out with table prefixes)
Comment #10
lesleyfernandes CreditAttribution: lesleyfernandes commentedsubscribing
Comment #11
katbailey CreditAttribution: katbailey commentedSo it turns out that the whole preparation of objects for tokenization bit was not in good shape at all. Here's yet another patch that hopefully gets this in decent shape. Curious to know if anybody else is waiting for this for D7 or am I the only one?
Comment #12
lesleyfernandes CreditAttribution: lesleyfernandes commentedI'm also waiting for the new version.
Comment #13
katbailey CreditAttribution: katbailey commentedSo, the objects created in the loadObjects method aren't only for the purposes of tokenization, we also need to grab the nid of hte activity from one of the objects. Yet another patch, this time overriding the determineNid method, so that it grabs the nid from the flag-action object we created during loadObjects.
Wheeeeeeeeee - having so much fun wiht this patch... all on my lonesome :-P
Comment #14
katbailey CreditAttribution: katbailey commentedFixing a NULL parameter being passed to url() instead of an empty array (this was affecting comment flagging). New patch...
Oh, and no more 2-part patches from me - I haz teh git rebase interactive skillz :-)
Comment #15
katbailey CreditAttribution: katbailey commentedI was incorrectly passing an array into user_load (as per the D6 way) causing entiy->load() to barf. New patch...
Comment #16
katbailey CreditAttribution: katbailey commentedYet another minor fix... I was using "current_user" as the message key for the person who performed the flagging - this works when the message is first generated, i.e.when the flagging actually takes place - but when an admin then does a bulk recreation of messages, the "You flagged..." message gets incorrectly set for the admin user who carried out the bulk operation rather than for the person who did the flagging.
Comment #17
katbailey CreditAttribution: katbailey commentedWith the fix in the previous version, I see no reason not to be able to batch regenerate flag-based activity messages now. Setting batch to TRUE in this version.
Comment #18
g76 CreditAttribution: g76 commentedsubscribe
Comment #19
pribeh CreditAttribution: pribeh commentedHey, how easy will this be to backport to Activity for D6?
Comment #20
katbailey CreditAttribution: katbailey commented@pribeh my understanding is that the D7 version of activity module is a complete overhaul - I haven't looked at the D6 version at all so I can't say :-/
Comment #21
ngstigator CreditAttribution: ngstigator commentedusing patch from #17, Fatal error: require_once() [function.require]: Failed opening required './sites/all/modules/contrib/activity/modules/flag.activity.inc'
fixed by moving "sites/all/modules/contrib/activity/flag.activity.inc" to "module" subfolder.
thanks for all the work, kat!
Comment #22
ngstigator CreditAttribution: ngstigator commentedAre there any plans to make available the title of the node that was flagged in the flag entity hook?
Comment #23
katbailey CreditAttribution: katbailey commentedTo grab the node title of the flagged node, use [flag-action:content-title]. And yes, this should totally appear in the available tokens... ;-)
Comment #24
ngstigator CreditAttribution: ngstigator commentedThx Katherine! I had a look at exposing those tokens and it was not intuitively obvious to me :-P
Another hidden token is [flag-action:content-url], so to display as a link we can do this:
<a href="[flag-action:content-url]">[flag-action:content-title]</a>
Comment #25
likewhoa CreditAttribution: likewhoa commentedsubscribing