Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
Porting this will require a significant effort. Token module has been rolled into core, but it has a different syntax and it tackles some of the difficulties that we worked around. It will take a careful hand to port this bad boy.
Drupal 7 branch will have to be drastically different. The database layout will be identical, but the code base will need to change greatly. Because of the three main components
/me wonders if it would be better to use a different event system... we found a few pitfalls with actions and triggers and i'm wondering if this might be more suited for messaging/notifications instead...
I really like this, it removes cruft that we had before around 'types' and 'type check'. It encapsulates logic into handlers that can do new and interesting things with them. It only works for node_insert right now and it only records, there is no Views integration, but that is a straight forward port.
Essentially, a handler is tied to a hook. You can use the same handler for as many hooks as you want, and thats the plan for NodeActivityActionHandler. It will be 'batchable' for everything but node_update.
The activity_action_handlers.inc is worth a good read through.
The activity_access table is now properly written too. So I think I have the API in place for recording actions around the Trigger / Actions system. I hope to start building out the user and comment stuff soon. Doing that might show some holes in the system.
I think this hook_activity_api() provides enough metadata.
Once I have it stable and in place, I will introduce Batch updating and redoing messages. Should be really easy with the new handler system.
Pushed a bunch of updates and stuff. I have all the node operations working now, and I added token stuffs. The new Token api is awesome. To wet your whiskers a bit
[current-user:activity-profile-link] updated [node:activity-node-link] by [node:author:activity-profile-link]
node -> author -> activity-profile-link. O man, does that make life so much easier. We can now officially handle user flagging, user voting.
With hook_hook_info: http://api.drupal.org/api/function/hook_hook_info/7 there really isn't much need for the 'file' attribute in the api hook in my previous comment. It is required for Activity implementing the node / user / comment stuff, but normal modules won't need it.
More changes have been pushed to Github. Notable bugs
1.) Viewing a node semantics are wrong.
2.) Several of the menu callbacks don't work properly
3.) Still links to admin/build/activity.
4.) When you create a new template, you will get a bunch of warning messages about unset variables. This is because options and the templates don't default properly. This probably should be part of a constructor.
#14 is awesome - love those features and it will save me a lot of really crazy-looking SQL statements that I have been using to update previous activity messages. Are you planning to include those in 6.x-2.x-dev as well or are they requiring the new D7 features?
These new features are taken from this work here which I would love a review: #463854: Generate activity on a current site. I want to commit that patch but not without other people giving it a try.
These exact changes require an api change so they don't belong in the 2.x series. Maybe, if someone is willing, a 3.x series. The reason really is because with D7, php5 is required so I can do things like abstract classes. But if you give the issue above a review, I think you can start avoiding those ungodly SQL queries you are running ;-)
Hi scott forked your Activity project on github and playing around with it. Great stuff!
Looks like a few things are missing (like comment.activity.inc) that the module is looking for. Is that intentional - should I just comment out comment_activity_api function for the time being or could you add those in your rep?
Thanks,
Ronald
ps: after playing a but around with it I should actually be able to offer something useful rather than just more questions!
I started testing your latest code from Github and noticed that all of the module configuration options are only showing up for the admin user (User #1). I'm also not seeing any permissions supplied by the module on the site permissions page.
Have you not got around to adding permissions yet or is there some other bug at work here?
Now I think it is API complete, and it does everything that 2.x does (+ MORE!). It is now just a matter of fixing the bugs that don't work and creating the implementations for other modules. This time around, Activity should maintain the api for the other modules because A.) I ended up writing them anyways B.) People come here for support for them and C.) Keeps me in touch with everything that is going on.
Major feature
- When creating a new template for node insert, user register and comment insert you can click "Save and Create" which will take the template you just created and create Activities that happened in the past. I think this is a major usability win
Regressions
- Views changed how it does query substitutions AGAIN. So Views handlers are busted.
Over 80% test coverage (i believe) on the recording side of things. There isn't an upgrade path yet, but it should be really simple.
Any idea of a "I'd say 40% done before we can release an alpha" or anything? :)
I hate doing that at work, fat chance of me doing that for my fun on my own time stuff :-P
edit:o and the whole activity_username thing needs to be updated. It works, but D7 provides interesting things for the name handling. Also, would like to start work on advanced help integration.
edit Forgot to mention, Token isn't required anymore, but creating messages without it is pretty hard.
So seeing as there's no 7 branch here do we have to post issues/patches/etc in github? I'm currently having fun with another silly "Recoverable fatal error: Argument 1 passed to drupal_attributes() must be an array, null given" type error, seems like the Activity themed stuff doesn't work :) Am working on it (very slowly, still learning).
Aside from a couple warning messages already mentioned, the version on github is working great! Don't hesitate to use it simply because it isn't on d.o.
My only bug report is that the update and regenerate messages operations do not appear to be available for all hooks. I have not extensively tested this, but I have been unable to get those operations to work with the Node Update hook. This can be worked around, however, so it is nowhere near critical. Great module!
Still, if there was a 7.x branch we could file issues for it, download with drush, etc.
Its not going to stop me trying it out (I intend to try activity 7.x sometime over the next few weeks and I'll use it in whatever state it is then) but it would still be more convenient.
My only bug report is that the update and regenerate messages operations do not appear to be available for all hooks.
That is because not all hooks can do these things. They have to have an atomic record outside of Activity (i.e. comment insert has a record in the comment table, where node update doesn't have a record, as the 'log' of updates doesn't exist).
Comments
Comment #1
Scott Reynolds commentedPorting this will require a significant effort. Token module has been rolled into core, but it has a different syntax and it tackles some of the difficulties that we worked around. It will take a careful hand to port this bad boy.
Comment #2
Bilmar commentedsubscribing - I look forward to helping with testing as D7 version is developed.
Thanks very much in advance!
Comment #3
likewhoa commentedsubscribing!
Comment #4
BenK commentedSubscribing...
Comment #5
spacereactor commentedsubscribing
Comment #6
johngriffin commentedWe can help with development and testing once there is a d7 branch underway
Comment #7
Scott Reynolds commentedDrupal 7 branch will have to be drastically different. The database layout will be identical, but the code base will need to change greatly. Because of the three main components
The first two changed drastically.
Comment #8
sirkitree commented/me wonders if it would be better to use a different event system... we found a few pitfalls with actions and triggers and i'm wondering if this might be more suited for messaging/notifications instead...
Comment #9
Scott Reynolds commentedAhh big no on notifications / messaging. Im am a co maintainer of those projects now but no. I think it would be a mistake.
I started a port last night: http://github.com/SupermanScott/Activity
I really like this, it removes cruft that we had before around 'types' and 'type check'. It encapsulates logic into handlers that can do new and interesting things with them. It only works for node_insert right now and it only records, there is no Views integration, but that is a straight forward port.
The api looks like this
Essentially, a handler is tied to a hook. You can use the same handler for as many hooks as you want, and thats the plan for NodeActivityActionHandler. It will be 'batchable' for everything but node_update.
The activity_action_handlers.inc is worth a good read through.
Comment #10
Scott Reynolds commentedJust pushed another change. The api looks like this now
The activity_access table is now properly written too. So I think I have the API in place for recording actions around the Trigger / Actions system. I hope to start building out the user and comment stuff soon. Doing that might show some holes in the system.
I think this hook_activity_api() provides enough metadata.
Once I have it stable and in place, I will introduce Batch updating and redoing messages. Should be really easy with the new handler system.
Comment #11
Scott Reynolds commentedPushed a bunch of updates and stuff. I have all the node operations working now, and I added token stuffs. The new Token api is awesome. To wet your whiskers a bit
node -> author -> activity-profile-link. O man, does that make life so much easier. We can now officially handle user flagging, user voting.
With hook_hook_info: http://api.drupal.org/api/function/hook_hook_info/7 there really isn't much need for the 'file' attribute in the api hook in my previous comment. It is required for Activity implementing the node / user / comment stuff, but normal modules won't need it.
Comment #12
Scott Reynolds commentedMore changes have been pushed to Github. Notable bugs
1.) Viewing a node semantics are wrong.
2.) Several of the menu callbacks don't work properly
3.) Still links to admin/build/activity.
4.) When you create a new template, you will get a bunch of warning messages about unset variables. This is because options and the templates don't default properly. This probably should be part of a constructor.
Comment #13
Scott Reynolds commentedooo check this out:
http://skitch.com/supermanscott/dfhn4/test-messages
You can test your messages before saving them. So you can test them on existing nodes / users / comments etc.
Comment #14
Scott Reynolds commentedwoot! and you can now update existing messages: http://skitch.com/supermanscott/dfhen/update-existing
So you change the template after a few weeks and click that button. The old messages are transformed into the new system.
When you update a node, all messages associated with that node are regenerated. Same for comments.
When you update a user, all their activities are regenerated.
Those last one is too aggressive might just adjust it to 'if the name changed'.
Comment #15
rjbrown99 commented#14 is awesome - love those features and it will save me a lot of really crazy-looking SQL statements that I have been using to update previous activity messages. Are you planning to include those in 6.x-2.x-dev as well or are they requiring the new D7 features?
Comment #16
Scott Reynolds commentedThese new features are taken from this work here which I would love a review: #463854: Generate activity on a current site. I want to commit that patch but not without other people giving it a try.
These exact changes require an api change so they don't belong in the 2.x series. Maybe, if someone is willing, a 3.x series. The reason really is because with D7, php5 is required so I can do things like abstract classes. But if you give the issue above a review, I think you can start avoiding those ungodly SQL queries you are running ;-)
Comment #17
ronald_istos commentedHi scott forked your Activity project on github and playing around with it. Great stuff!
Looks like a few things are missing (like comment.activity.inc) that the module is looking for. Is that intentional - should I just comment out comment_activity_api function for the time being or could you add those in your rep?
Thanks,
Ronald
ps: after playing a but around with it I should actually be able to offer something useful rather than just more questions!
Comment #18
Scott Reynolds commentedIt isn't needed. Drupal is able to autoload the classes from activity_action_handlers.inc just fine.
It might produce some warnings though.
Comment #19
BenK commentedHey Scott,
I started testing your latest code from Github and noticed that all of the module configuration options are only showing up for the admin user (User #1). I'm also not seeing any permissions supplied by the module on the site permissions page.
Have you not got around to adding permissions yet or is there some other bug at work here?
Thanks,
Ben
Comment #20
BenK commentedAlso, would you like bug reports added to this thread or would you prefer them somewhere else?
Cheers,
Ben
Comment #21
Scott Reynolds commentedI would like it in this thread for a little while. I really should just roll it into D.o
Comment #22
Scott Reynolds commentedMade another major update: https://github.com/SupermanScott/Activity
Now I think it is API complete, and it does everything that 2.x does (+ MORE!). It is now just a matter of fixing the bugs that don't work and creating the implementations for other modules. This time around, Activity should maintain the api for the other modules because A.) I ended up writing them anyways B.) People come here for support for them and C.) Keeps me in touch with everything that is going on.
Major feature
- When creating a new template for node insert, user register and comment insert you can click "Save and Create" which will take the template you just created and create Activities that happened in the past. I think this is a major usability win
Regressions
- Views changed how it does query substitutions AGAIN. So Views handlers are busted.
Comment #23
NathanM commentedSubscribing.
Comment #24
mike503 commentedSubscribing, hard to tell what status this is in really. Any idea of a "I'd say 40% done before we can release an alpha" or anything? :)
Comment #25
Scott Reynolds commentedThe current code: https://github.com/SupermanScott/Activity/ (direct download: https://github.com/SupermanScott/Activity/tarball/master) works for all node, comment and user activities. You have to apply one patch for relationship handling: #1011266: Error getting relationship handler label from non-object. (or apply this: https://github.com/SupermanScott/Activity/blob/master/views_1011266_admi...) but it works with the latest Views.
Over 80% test coverage (i believe) on the recording side of things. There isn't an upgrade path yet, but it should be really simple.
I hate doing that at work, fat chance of me doing that for my fun on my own time stuff :-P
edit:o and the whole activity_username thing needs to be updated. It works, but D7 provides interesting things for the name handling. Also, would like to start work on advanced help integration.
edit Forgot to mention, Token isn't required anymore, but creating messages without it is pretty hard.
Comment #26
Scott Reynolds commentedI believe the only thing remaining is the upgrade path now. Please check it out via the links in the previous post and report any bugs.
Activity comments are ugly, but I think the markup is sane enough to allow some proper theming.
edit: And the Views patch mentioned previously was committed today. so Views 7-3 should work nicely with the current Activity.
Comment #27
Valeratal commentedSubscribing
Comment #28
snupy commentedSubscribing
Comment #29
sw3b commentedSubscribe
Comment #30
jennifermontes commentedSubscribe
Comment #31
Scott Reynolds commentedNo need to subscribe fellas, try it out from github.
Comment #32
ryivhnn commentedSo seeing as there's no 7 branch here do we have to post issues/patches/etc in github? I'm currently having fun with another silly "Recoverable fatal error: Argument 1 passed to drupal_attributes() must be an array, null given" type error, seems like the Activity themed stuff doesn't work :) Am working on it (very slowly, still learning).
Comment #33
jennifermontes commentedI just tried your patch and it works like a charm.
Comment #34
danielm commentedSubscribe
Comment #35
jennifermontes commentedChanged the thread title to make it easier to keep track of.
Comment #36
Shadlington commentedSoooo... How about a release on d.o?
Comment #37
jarush commentedThanks
Subscribe.
Comment #38
dgastudio commented+1
Comment #39
salimai commentedAside from a couple warning messages already mentioned, the version on github is working great! Don't hesitate to use it simply because it isn't on d.o.
My only bug report is that the update and regenerate messages operations do not appear to be available for all hooks. I have not extensively tested this, but I have been unable to get those operations to work with the Node Update hook. This can be worked around, however, so it is nowhere near critical. Great module!
Comment #40
Shadlington commentedStill, if there was a 7.x branch we could file issues for it, download with drush, etc.
Its not going to stop me trying it out (I intend to try activity 7.x sometime over the next few weeks and I'll use it in whatever state it is then) but it would still be more convenient.
Comment #41
Scott Reynolds commentedThat is because not all hooks can do these things. They have to have an atomic record outside of Activity (i.e. comment insert has a record in the comment table, where node update doesn't have a record, as the 'log' of updates doesn't exist).
Comment #42
ngstigator commentedSubscribe
Comment #43
Scott Reynolds commentedreleased: http://drupal.org/node/1098626