Active
Project:
Activity Log
Version:
6.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Nov 2011 at 17:37 UTC
Updated:
10 Jul 2012 at 22:54 UTC
Jump to comment: Most recent file
I'm trying to add an additional 'After saving content' activity log rule in Commons, which treats nodes of certain types differently to the rest.
However, even though the two log rules are themed totally differently, whichever rule triggers last is the rule that will theme all node activity log messages. It doesn't seem to matter what conditions I use to separate them, the best I can do is make certain messages disappear from any view, if it renders it will always use the last node_insert activity log template by weight.
I don't know if I'm misunderstanding the API and this is something I just can't do?
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | node_not_blog_in_group.txt | 25.07 KB | lightsurge |
| #5 | blog_in_group.txt | 24.94 KB | lightsurge |
Comments
Comment #1
lightsurge commentedI'm guessing this might be down to the intelligent caching that's going on which is presuming that all messages created on the node_insert event should be themed the same way... but I've tried turning off caching on each of the activity log actions for both node_insert rules, but without success.
Or something to do with this
Which sounds like if it goes wrong it could be a bit like when you mess up your washing and everything comes out the same colour.
Comment #2
lightsurge commentedI have a feeling the only way I can accomplish what I'm trying to do is use a token to change the appearance of an activity log message between content types.
Comment #3
icecreamyou commentedActivity Log will only save messages from one template per event in order to make sure you don't see two activity messages for the same event. This only kicks in for templates that actually get invoked when an event occurs, so if you're seeing a template you don't expect, it means that your Rules conditions are wrong. Activity Log has some default actions that correctly use conditions to make sure the right template is used (e.g. personal status updates vs. status messages to groups with attachments, or nodes created in a group vs. not in a group). If you have Rule (A) for "saving a node" and Rule (B) for "saving a wiki node" then if Rule (A) has higher weight it will always be invoked; instead you need to change Rule (A) to "saving a non-wiki node."
Also, use the development release. IIRC there's a fix in there for a problem related to this although I think that was only related to regenerating activity.
Comment #4
lightsurge commentedIt sounds like I should be able to do what I'm attempting then. I have rule 1 which is set to only trigger for node type A, and rule 2 is set to trigger only for node type B. I've tried different types of conditions to test if a particular type of condition wasn't working. I used the standard 'node is type' condition, a 'truth' condition, and a custom php condition.
The best I could do with these conditions was prevent a node type from appearing in the activity log (by removing one of my rules).
My conditions seem to be working, but whatever I do, the log messages seem to get themed by the higher weight rule.
This is a vanilla test install of Commons 2.0 btw.... I'll give the activity log dev release a whirl.
Comment #5
lightsurge commentedStill having this problem with latest Activity Logs and Rules dev releases.
It just doesn't seem to like me splitting up nodes by type, splitting them by whether or not a node is posted in a group obviously works fine.
Attached are my two rules for reference.
Comment #6
icecreamyou commentedAfter upgrading to the development release you might need to try re-creating the Rules in question from scratch. I'm not sure why but sometimes that fixes things.
Comment #7
lightsurge commentedI'll have a crack at installing the Commons github dev release to test this and #1338586: FBSS + Activity Log problem... I understand that it includes the latest activity log module.
Comment #8
lightsurge commentedWith a fresh installation of latest devel Commons 2.x with latest activity logs (6.x-2.x from git) as standard... the issue remains.
Steps to replicate:
Comment #9
lightsurge commentedComment #10
ezra-g commentedHi @lightsurge - Thanks for trying to test this!
Are you using the 6.x-2.x dev of Commons from the GitHub repository or Drupal.org? We're working to make nightly development snapshot downloads available based on the Drupal.org repository, but in the meantime, the best way to get Commons is building it by Drush make. Development is no longer happening on GitHub.
If you're around and wish to join #drupal-commons in IRC, I'd be happy to help get this setup or provide you with a tarball until we get those generally publicly available.
Comment #11
lightsurge commentedI built it with drush make from http://git.drupal.org/project/commons.git with branch 6.x-2.x (wasn't sure if this was the best one to use or dev... you seemed to be committing to 6.x-2.x while laurentc was committing to the dev!)
Comment #12
icecreamyou commentedI can confirm the problem, although I have no idea why it's working with some conditions (like whether a node is in a group, or whether a status is a personal update or a message to someone else) but not others.
Comment #13
lightsurge commentedAt least I'm not just missing something. It occurred to me that in terms of troubleshooting, considering that whether or not you use a truth condition, a 'CCK field contains' condition, 'node is type' condition etc etc and it still fails.. this might point towards the earlier conditions taking some kind of quirky precedence.
Comment #14
icecreamyou commentedI'm not sure. In theory Activity Log should never record messages for conditions that fail because the relevant actions will never get invoked. However I added "Display a configurable message on this site" actions to my test Rules and the correct message displayed that way. I am not sure what to interpret from that.
Comment #15
crea commentedI noticed that some rules have duplicate tid in the database - I think this is the reason. Recreating all rules from the start is a no option (they are too complex).
Maybe duplicate tids have something to do with cloning of rules ?
Comment #16
crea commentedI think it's because of cloning. Activity Log doesn't seem to process clone form properly. If the tid storage is done by Rules, cloned rules probably have same tids.
Comment #17
crea commentedI was able to fix it by rebulding rules_rules table programmatically and ensuring all actions have unique tids.
Comment #18
crea commented