It would be useful to be able to export and import activity definitions to and from code. Is there any plan to implement this functionality? Are there any known roadblocks, architectural or otherwise, to writing such a patch?

Comments

sirkitree’s picture

I would love to have this feature actually. I'd like to look into using ctools' export functionality for this. I tried writing a couple of exported triggers but ran into some road blocks and then other things took priority.

So yes, patches welcome.

rickvug’s picture

Issue tags: +CTools exportables

tagging.

sirkitree’s picture

Since ctools 1.7 has a nice new export ui i'm going to give this a shot. need it for a project.

gdd’s picture

omg +1

sirkitree’s picture

this may actually replace the current multi-form wizard - which will proly actually reduce code, but place a dependency on ctools - i'm kinda ok with that though.

Scott Reynolds’s picture

I think your going to hate this. I went down this road a couple times and came back thinking it wasn't possible. The problem is actions_do().

$actions[$action->aid] = $action->parameters ? unserialize($action->parameters) : array();

In order to get parameters to be passed in they have to be serialized. If it was instead

$actions[$action->aid] = $action->parameters ? (is_array($action->parameters) ? $action->parameters : unserialize($action->parameters)) : array();

Really, actions.aid can be strings, but actions_do and other place treat is_string($actions.aid) differently then is_numeric($actions.aid).

Makes for a hellva mess.

mikebell_’s picture

Subscribe, this would be really handy for my current project.

jcisio’s picture

This feature could make it easier for users to start rolling out their websites. It is better than #669196: Default messages, but in some way, the other issue can help, too.

About Ctools dependency, it's the best if we divide the module into Activity and Activity UI, only the admin part (Activity UI) is dependant on Ctools. In production site, we can disable both of them.

dafeder’s picture

Subscribe. May take a crack at a patch if I have time - scott how far did you get?

Scott Reynolds’s picture

I got to the point where it was clear its not possible without writing our own Trigger/Action framework

In http://api.drupal.org/api/function/actions_do/6, it array_merges($context, $parameters). The issue is, that only happens with the aid is numeric (ie stored in the database). There isn't a way for a action that isn't numeric, to get the parameters into the activity_record function.

So its stuck.

Edit: The other option is to store our options array outside of the action storage. This would then make Activity make a trip to load the parameters but wouldn't require a completely new Trigger/Actions framework. Unfort, this too isn't enough as there needs to be a record in the trigger_assignments table so Trigger knows how to fire it off.

dafeder’s picture

Status: Active » Postponed

Yeah - I can see the problem. I think storing parameters separately would be worth it, but I don't expect everyone to have the same priorities as me :)

Another thing I can think of is using rules instead of actions, but I'm sure you've already ruled that out for any number of reasons.

ademarco’s picture

+1

lelizondo’s picture

subscribing

thomjjames’s picture

subscribing

_shy’s picture

Issue summary: View changes
Status: Postponed » Closed (outdated)

D6 reached its EOL back in February 2016, and there is no active release for D6 for this module anymore.
Development or support is not planned for D6. All D6-related issues are marked as outdated in a bunch.

If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.