Closed (fixed)
Project:
Drupal Commons
Version:
6.x-2.4
Component:
Activity/status streams
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Sep 2011 at 11:31 UTC
Updated:
4 May 2012 at 12:40 UTC
See #1292118: no digests
Activity log digest module just doesn't seem to be doing anything.
Comments
Comment #1
ezra-g commentedI'm seeing the same thing on an intranet site with >100 users where nobody has received email digests since we updated from Beta1 to 2.0 of Commons.
Comment #2
ezra-g commentedI experienced a problem like this which I started troubleshooting with some wacky patches at #1257754: Users not subscribed to digest unless they submit digest settings form. However, some Commons contributed modules are ouf of sync from Drupal.org, so we should address that before extensive troubleshooting.
Comment #3
lightsurge commentedI'm now seeing this error message on every cron run which might reflect the issue:
mysqli_fetch_object() expects parameter 1 to be mysqli_result, object given in /includes/database.mysqli.inc on line 150.However I can't find any record of digests.module calling this function. But having said that looking at the code gives me a bit of a headache.
I can't find any way to see these activity logs that Rules creates. Disappointing if the only way you can see if it's doing its job right is directly in your database.
Edit: Think I'm misunderstanding how digests and rules work after noticing that it's digests that creates the tables.
Comment #4
lightsurge commentedOk I see now, digests.cron.inc must be calling a dodgy db_fetch_object somewhere or other... although if this is the best error message we can get, could be pretty much anywhere really ;-)
Comment #5
lightsurge commentedI hope somebody else posts here and says whether or not they have activity log digests working. Apart from server differences the only real difference between a vanilla installation of Commons I'm using is that I'm using a private file system.
Comment #6
lightsurge commentedI've been troubleshooting this and it would seem that the Rules in place to save activity in email digests don't seem to be working...
The only activity it seems to be recording is users joining groups... To test, just edit the activities view, change Activity Log: Display Type to email digests.
Also if you then pass an argument it filters out everything but activity initiated by that user, so that user/1 just shows details of the groups user 1 has joined.
I also notice this in the user profile:
If these are the only 'types' of activity allowed on the email digest display type, this might explain why there's nothing else in there.
I suppose this shouldn't necessarily explain why we're not getting digests, I suppose it should mean we'd be getting a daily digest with just details of the groups we ourselves join...
Comment #7
lightsurge commentedI'm having fun and games with this today... So, I tried regenerating activity log data. This turned everything around, suddenly all the stream logs showed were people joining groups, but the email logs showed all the right information... So I though AHAH, it must be the rule weightings... So I changed all the Email rule weightings to 1, and streams to 0.
Regenerated, and behold, it's back the way it was, with the stream showing properly and the email stream just showing groups!
For some reason Rules just stubbornly refuses to save the information in both logs, except for group joining. It's one or the other - and I don't know why :-S
The next thing to try obviously is to add another action to the stream rules, rather than have cloned rules... I'm not sure whether to try this or if something is broken and I should just calm down and wait!
Comment #8
lightsurge commentedI did try merging the email actions into the stream rules, but this didn't work either.
I also tried simply disabling all the email rules to see what would happen when I regenerated the logs, and bizarrely the email digest logs still displayed the 'User join group' messages...
If you disable all the stream rules and regenerate activity, then again the email digest logs are fine, and same as above the stream logs aren't empty, they still contain the 'User joined group' messsages.
Comment #9
lightsurge commentedThere's a fix at #1292118: no digests which looks to have sorted the problem with the activity log Rules, and therefore hopefully the problem with digests (can't confirm yet).
Comment #10
lightsurge commentedIt looks like this is still an issue... unless @ezra-g has had any digests since the rule was fixed?
Comment #11
lightsurge commented#1292118: no digests
Comment #12
frifoles commentedI'm also experiencing this issue on my Commons site. I don't get any cron job errors when executed manually or via poormanscron.
I'm still using the same Activity Log Email Digests module packaged with Commons 2.0.
@lightsurge, any luck getting digests to properly work on Commons?
Comment #13
lightsurge commented@frifoles
Not at all... taking advice from #1257754: Users not subscribed to digest unless they submit digest settings form and updating to dev version of digests http://drupal.org/node/1292118#comment-5053584 my users still weren't getting (sensible) digests.
I do now have digests, but not with the digests module, instead I
I'm actually finding although this method is probably much more cpu-intensive (in terms of simplenews at least), even with my test user-base of >50 users I'm only seeing a few seconds to process all emails which I'm okay with. And I'm getting beautiful digests at last, so I'm happy, and my user-base get emailed there's new content to see, as I promised!
This will do me until the digests module is fixed.
Comment #14
lightsurge commented@ezra-g
I'm not convinced this will be solved as part of #1256076: Activity Stream modules are out of sync with Drupal.org
Comment #15
omissis commentedHi, is there any news about this issue? It looks like I ran into the same issue.
Thank you in advance
Comment #16
icecreamyou commentedI believe this commit should fix it. Can anyone confirm? Obviously this is kind of difficult to test, but this fix gets rid of an error that stops the "send" loop from running.
Comment #17
ezra-g commentedThanks, @IceCreamYou! I can integrate this commit into the Commons Drush make file and publish a development release of Commons this week, and test that on an actively used intranet site to see if that fixes things.
Comment #18
omissis commentedHi, thank you! I'm going to try that patch now and report :)
Comment #19
omissis commentedwell appearently it doesn't fix the problem: $messages is empty, therefore the foreach loop is stepped over and -i suppose- email ain't sent out.
As you can see from message log, the actions for "Emai: Log activity when a user sends a status message" are executed:
Status message sent
0 ms "User saves a status" has been invoked.
0.117 ms Executing the rule "Log activity when a user sends a status message" on rule set "User saves a status"
0.303 ms Condition "Status was posted as private" evaluated to FALSE.
0.453 ms Condition "User updated their own status" evaluated to FALSE.
3.971 ms Action execution: "Log activity for the recipient and @mentioned users"
87.496 ms Action execution: "Log activity for the acting user"
114.702 ms Action execution: "Log activity for members of the active group"
116.905 ms Action execution: "Show a configurable message on the site"
117.017 ms Executing the rule "Cross post on wall" on rule set "User saves a status"
117.112 ms Executing the rule "Log activity when a user saves a personal status update" on rule set "User saves a status"
117.251 ms Condition "User updated their own status" evaluated to FALSE.
117.315 ms Executing the rule "Log activity when a user sends a private message" on rule set "User saves a status"
117.443 ms Condition "Status was posted as private" evaluated to FALSE.
117.505 ms Executing the rule "Email: Log activity when a user saves a personal status update" on rule set "User saves a status"
117.633 ms Condition "User updated their own status" evaluated to FALSE.
117.695 ms Executing the rule "Email: Log activity when a user sends a private message" on rule set "User saves a status"
117.824 ms Condition "User updated their own status" evaluated to FALSE.
117.936 ms Condition "Status was posted as private" evaluated to FALSE.
117.998 ms Executing the rule "Email: Log activity when a user sends a status message" on rule set "User saves a status"
118.127 ms Condition "User updated their own status" evaluated to FALSE.
118.238 ms Condition "Status was posted as private" evaluated to FALSE.
120.83 ms Action execution: "Log activity for the recipient and @mentioned users"
137.69 ms Action execution: "Log activity for the acting user"
152.448 ms Action execution: "Log activity for members of the active group"
154.547 ms Evaluation of "User saves a status" has been finished.
Comment #20
lightsurge commented@omissis did you test this in combination with the patch at #1259944: Add a "send digest emails now" button which enables you to trigger the message send process? Otherwise, digests might think it's already sent messages out. (also note that IceCreamYou mentioned the latest dev version of Activity Logs could cause issues with tokens, but if not using dev you will still need the fix to Activity Logs at http://drupal.org/node/1292118#comment-5053584 as part of getting the email Rules working....)
Comment #21
omissis commenteduhm I see, no I haven't used those patches, I'll take a look thank you :)
Comment #22
icecreamyou commentedAs lightsurge noted, you probably just didn't have any activity to send. During cron, digests looks for activity from the previous day, so any activity you generated today wouldn't be sent in a digest. If you apply the patch in #1259944: Add a "send digest emails now" button, you can test that you're getting emails by sending messages that include the current day's activity, although that doesn't really help determine whether this issue is fixed. :-) And of course you should be using the dev versions of both Activity Log and Digests to test.
Comment #23
lightsurge commentedI'm not in a position to test this.. but, as a potential alternative that would also add additional newsletter features to Commons, there's some interesting developments going on at simplenews, if they could be backported:
http://drupal.org/node/700308#comment-5363988
I've been using a patched version of simplenews to send out activity log digests for a while, the advantage is it gives you much more flexibility over your digests' look and additional content.
Comment #24
Enideo commentedJust to say the patch at #16 worked for me on Drupal Commons 2.x
Comment #25
icecreamyou commentedIn that case let's mark this fixed. My test sites are local and not running cron but when I force Digests to run it does seem to send correctly.
Comment #26
frifoles commented@Enideo, did you apply any other patches and/or upgrade any of the existing contrib modules (Activity Log, Digests, etc.)?
I applied the patch myself, so I'll just have to wait and see tomorrow.
Comment #27
Enideo commentedOh hi, sorry for the delay, not on drupal.org every day.
I have applied the following patches to the same version used by commons (6.x-beta1):
table prefixes #1273288: Activity stream incompatible with table prefixes
FBSS + Activity Log problem #1338586: FBSS + Activity Log problem
empty statuses #1297902: Blank or default text for status updates showing as template code in stream
and regenerating for og #1344950: Regenerating activity messages does not remove old entries for users joining an organic group
(I tried the 6.x-dev version before but got lots of tokens errors so reverted back and used patches..)
Unfortunately, the email digests only worked for the first day, and may have been missing some items.
Nothing in my logs to report.
If you want me to add lines for watchdog please say.
For now (for me) this isn't an urgent issue although this function would be nice.
Thanks
Comment #28
ezra-g commentedAre you still having this issue on a fresh install or update to the latest Commons nightly dev snapshot?
Comment #29
Enideo commentedI'm afraid I cannot say myself. My site is currently in beta, has over a hundred active users and is for a paying client. As it's fairly customised, I can't risk the update to a dev version in case of module version conflicts.
For now, I don't even have a staging solution in place for these kind of trials..
Would love to know if anyone could confirm the dev version works for them! Can also provide more details about my setup if that would help
Comment #30
Enideo commentedAfter updating to 2.6, this issue has been resolved for my site.