Once the "winning formula" of #298109: Rules integration is reached, we can convert it to wfng.

CommentFileSizeAuthor
#7 flag_workflow_ng.info.txt111 bytescyu
#7 flag_workflow_ng.module.txt2.24 KBcyu

Comments

cyu’s picture

Will it even be possible for both workflow-ng and actions2 to be supported by a module? In this case, both workflow-ng and actions2 will be looking for flag_action_info() to define their respective actions. I had commented out Flag's actions support when I started messing with workflow-ng integration because the latest release throws errors if actions2 is not installed, but once I grabbed the CVS copy of Flag and saw that it gracefully degraded for actions1 I started getting errors because I was redefining flag_action_info().

Replacing

    if (module_exists('actions')) {
      include_once $path .'/flag.actions.inc';
    }

with

    if (_flag_have_actions_version_2()) {
      include_once $path .'/flag.actions.inc';
    }

should temporarily fix that for me, but if I upgrade my site to actions2 it will break it again.

If there is going to be workflow-ng support added eventually, it seems like you'll need a settings page where a choice must be made between actions2 support or workflow-ng support.

cyu’s picture

Here is a little bit of related history on this issue:
#235612: Fatal error: Cannot redeclare user_action_info

cyu’s picture

I guess one option is to actually have a separate module like flag_workflow_ng.module which would then have hooks that would not clash with the actions 2 hooks of flag.module

mooffie’s picture

Status: Active » Postponed

I'm marking this 'postponed' till the other issue gets settled:
#298109: Rules integration

Will it even be possible for both workflow-ng and actions2 to be supported by a module?

PHP has a function to inspect the call-stack, so the hook can return different things depending on who's calling.

But I think the issue you linked to says the problem was solved already.

quicksketch’s picture

Status: Postponed » Closed (won't fix)

I dare say this will never happen. I'm not working on Rules nor am are any of the maintainers working on Drupal 5, so Workflow-NG support is all but out of the question. Patches for this feature will probably not be considered, it's time to move to Drupal 6.

crea’s picture

Component: Code » Rules integration

Any idea how can I implement this backport myself ?
Is this backporting really hard, in case i'm not using Actions 2.0 ?

cyu’s picture

StatusFileSize
new2.24 KB
new111 bytes

I wrote some code which worked for me in 5 to integrate workflow-ng with flag module. I believe it takes a different approach than the rules integration in 6, but I'll post it here in case anyone stumbles across this issue and can make use of it. I agree about moving towards Drupal 6 so am leaving this as won't fix.

crea’s picture

Moving to 6 is only worth it for new sites.
I have one deeply developed community site with 5.x and moving it to 6 won't give anything worth the effort...only headache.
For established site it is easier to backport missing module when its greatly needed (which is very rare).