Flag has dropped the Activity support.
I have converted it to a patch and I'm attaching it here.
The 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).
Tested and it works fine.
It doesn't require any change in the existing settings.
Not sure if I should have opened a separate issue but here's a start at a D7 patch...
This version of the patch fixes tokenization and allows the patch to be used by drush make (i.e. rolled with --no-prefix).
This 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...
It'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)
So 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?
I'm also waiting for the new version.
So, 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
Fixing 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 :-)
I was incorrectly passing an array into user_load (as per the D6 way) causing entiy->load() to barf. New patch...
Yet 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.
With 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.
Hey, how easy will this be to backport to Activity for D6?
@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 :-/
using 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!
Are there any plans to make available the title of the node that was flagged in the flag entity hook?
To grab the node title of the flagged node, use [flag-action:content-title]. And yes, this should totally appear in the available tokens... ;-)
Thx 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>
Drupal is a registered trademark of Dries Buytaert.