Would be awesome if there were a way to export configured events (trigger + actions) from the database. This would need to work for any category/module that integrates with triggers (eg Comment triggers, Content triggers, Cron triggers, Organic Groups triggers, Taxonomy triggers, Users triggers, Workflow triggers).
Was unable to find much on this topic via google and d.o searches. I also dont know much about the progression of triggers and actions module for d7 to address long term feasibility of implementing this. Thoughts?
Comments
Comment #1
q0rban commentedHere's a patch for this.
Comment #2
ericduran commentedOh, this is nice.
Comment #3
q0rban commentedUpdated patch adds a hook_features_rebuild() implementation. Rebuilding does not delete existing trigger_assignments but does create new ones.
Comment #4
alfthecat commentedHey q0rban,
Would there be a patch for D6 for this?
Comment #5
q0rban commented@AlfTheCat, nope, I don't have one. Care to try your hand at rolling one? It shouldn't be that hard, the database API stuff will be a little tricky, but that's it.
Comment #6
alfthecat commentedThanks q0rban, since I haven't gotten into D7 at all yet (waiting on more functionality) I have little faith in my own abilities for such an attempt at this point :)
When I do I'll try.
Thanks again!
Comment #7
q0rban commentedThe patch may work as is by simply rewriting all the DBTNG stuff as D6 db_query()'s. The trickiest one to solve will be the db_merge(), but you can do a db_query("UPDATE..."); if (!db_affected_rows()) { db_query("INSERT..."); } there. You can do it! Give it a shot. :)
Comment #8
drzraf commentedthanks q0rban, I just tested and it seems to export triggers quite well.
any hope on getting "actions" exportable too ?
Comment #9
kenorb commentedAgainst the latest dev.
Comment #10
kenorb commentedMarked as duplicate (D6):
#997632: Support for action configurations?
Related:
#1083394: Meta issue: Features support for core component types added in D7
Comment #11
kenorb commentedMy trigger assignment was exported as follow:
This is only the assignment, but the information about the action available at: admin/config/system/actions/configure/280 has been lost.
This include Label and some specified settings (for Email e.g. Recipient, Subject, Message).
Those settings are stored in {actions} table.
Comment #12
mile23Really ancient core discussion here: #245331: Trigger module should offer exports of actions
Comment #13
kenorb commentedTrigger module has been removed from Drupal 8 core (#764558: Remove Trigger module from core).
Actions API will be changed as well (#1846172: Replace the actions API).
Alternative module: http://drupal.org/project/rules
See also:
#1211396: [META] Getting started with Rules 8.x
Comment #14
colinmcclure commentedRe-rolled patch against latest dev branch as needed for a project. Thought would share as someone might need it.
Comment #15
kenorb commentedComment #16
jeffschulerLatest patch (in #14) no longer includes most of the necessary code from the one in #9.