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.
eg, "Ezra posted a discussion ABCD into group X" but not "Groups X, Y and Z".
I'm not sure if Activity log actually supports displaying different updates or grouping to display all groups the node is posted into.
I asked for clarification at : http://drupal.org/node/1244930#comment-4893990
Comment | File | Size | Author |
---|---|---|---|
#10 | activity_logs_cross_posting-1256754-10.patch | 9.02 KB | lightsurge |
#9 | activity_logs_cross_posting-1256754-9.patch | 8.89 KB | lightsurge |
Comments
Comment #1
ezra-g CreditAttribution: ezra-g commentedThis is not a release 2.0 blocker per batsonjay.
Comment #2
IceCreamYou CreditAttribution: IceCreamYou commentedFor reference, in activity_log.rules.inc we are currently doing something like this:
What we need to do is this:
Then we need to make the callbacks in activity_log.entity_groups.inc aware of this.
I think we also need to have the (single) active group available for some of the callbacks, but I'm not sure.
Comment #3
lightsurge CreditAttribution: lightsurge commentedDo I understand right then that as an interim measure, a node could be logged against multiple group streams... (such that in every group a node is posted into, it would create a log entry in the /group stream in a similar form to which it currently does, but in all associated groups rather than just the first)...
But that logging a 'grouped' message such as
against the /user streams is more complex and would be better postponed till after the architecture change?
That sounds great to me, if the activity is in the group streams that's much better than nothing.
Comment #4
ezra-g CreditAttribution: ezra-g commentedComment #5
IceCreamYou CreditAttribution: IceCreamYou commentedActually, showing e.g. "Ezra posted a discussion into groups X, Y, and Z" isn't very hard either. We'd just have to add a token for showing multiple groups.
Comment #6
lightsurge CreditAttribution: lightsurge commentedSounds good although might we not end up with the same can of worms as #1293414: stream view paginates on total number of messages in a users log, even if a viewing user has no access to see some in terms of disclosing closed/private group names to people who don't/shouldn't know about them?
Comment #7
IceCreamYou CreditAttribution: IceCreamYou commentedNo, that's different.
Comment #8
lightsurge CreditAttribution: lightsurge commented@IceCreamYou is there any particular reason we can't use $event->target-id in _activity_log_get_active_group_members() rather than doing the work in activity_log.rules.inc?
I was starting to look at this at least in terms of logging into the streams of all users in all groups a node belongs to, and then planned to use a token to filter down the multiple groups appearing in the messages to the groups the viewing user has access to, maybe by just using og_node_groups_distinguish().
Then I realised it's going to get messy for example when:
Comment #9
lightsurge CreditAttribution: lightsurge commentedThought I might as well post as far as I got... Basically this does as above then adds a token to build a themed list of group links, just a simple quickfix to solve my problem for the interim (a lot of my users have figured out that cross-posting doesn't put items into the feeds or digests of users except in the first group... so instead they've started re-posting, meaning duplicate items in feeds on a large scale!).
This hasn't even been much tested by me, and I think it's not taking the most optimized direction, so use at your own risk! But in case it helps somebody.
Comment #10
lightsurge CreditAttribution: lightsurge commentedForgot to make it still work if a node isn't cross-posted :-D
Comment #11
lightsurge CreditAttribution: lightsurge commentedComment #12
IceCreamYou CreditAttribution: IceCreamYou commentedThanks for getting this rolling.
Less code. Then you only have to load the node in a single place instead of everywhere you want to use it.
Also, I think there are cases where $node->og_groups hasn't been set yet, in which case we need to explicitly find it:
Again, it's easier to do this in one place than to remember to do it everywhere you need it.
All you had to do was change the query from
nid = %d
tonid IN (". db_placeholders($node->og_groups) .")
.Instead of all this mess, use theme_activity_log_collapse($collection = array(), $method = 'activity_log_collapse_inline').
This patch also needs to remove the code in activity_log.rules.inc that sets
$event->og
, and remove all corresponding uses of it in activity_log.entity_groups.inc.Comment #13
lightsurge CreditAttribution: lightsurge commentedThanks @IceCreamYou!
I was rattling around trying to work out how to deal with the case of private groups... then noticed the code was commented out, can this be properly removed now, or sticking around for a reason?
Comment #14
lightsurge CreditAttribution: lightsurge commentedOh I remember now, this commit http://drupalcode.org/project/activity_log.git/commit/79ae53b
but which also causes the paging issue, which I'm guessing is why the code is still there, in case access goes back in here
Comment #15
IceCreamYou CreditAttribution: IceCreamYou commentedYeah access control should already be taken care of through the view filtering.
Comment #16
rgchi CreditAttribution: rgchi commentedUnfortunately the patch failed for me on a dev box. Of course I'm using Drupal Commons (Drupal core 6.26 with Drupal Commons 6.x-2.4).
$> sudo patch < activity_logs_cross_posting-1256754-10.patch
I restored a back up so things are working.
(Fuller explanation of my issue, possibly related to this: http://drupal.stackexchange.com/questions/39532/in-activity-stream-how-i...
Comment #17
lightsurge CreditAttribution: lightsurge commented@richardgoodrow this patch was unfinished, so you shouldn't use it, and Commons is moving away from using Activity Log for Commons 7.x, so this seems unlikely to happen in this thread. You should post an issue in the activity log project