I've created a workflow-ng entry that, upon creation of a node, is supposed to redirect to another page, carrying the new node_id along in the query string.

That part works, but something strange happens to node_access. Any nodes that are redirected by the workflow-ng action don't get a node_access entry, but nodes created without the workflow redirect work fine, and node_access is updated normally.

Is there something in workflow-ng that could be interrupting the part of node_save that fires off access entry creation?

Comments

amitaibu’s picture

Maybe this is connected?

fago’s picture

hm, I had a look at node_save() and unfortunately you are right.

the node grants are written after the invokation of hook nodeapi insert/update, which is used by workflow-ng. So if on redirects here, the redirect is applied immediately and so the access grants are not written.

Possible solutions!? Puh, perhaps a registered shutdown function could do it. I have to look at that.

Coyote’s picture

Thanks. I knew I wasn't crazy. Not about this, anyway. : )

amitaibu’s picture

Maybe we should set a different weight for the workflow-ng module?

fago’s picture

Status: Active » Fixed

No that doesn't help either :/

Anyway, I think I found a solution. -> committed. Check out the dev version. There is a new option for the page redirect action -> "override path redirect". Select this and it should work fine with node insert/update/submit events.

Please test and report the results.

Is the help text clear enough? I hope this doesn't complicate the redirect action too much :/ Perhaps, we should also warn people that configure the action on node insert / update without checking the option? hmmmmm

amitaibu’s picture

@Fago,
Help is a bit complicated. How about making this checkbox TRUE by default?

fago’s picture

Component: Code » Documentation
Status: Fixed » Active

hm, that won't work. In cases e.g. on a normal node view - where no page redirect is invoked elsewhere, no redirect would happen!

fago’s picture

I've committed an improvement that allows events to specify whether there is an redirect after the invoked event. -> This is used by the path redirect action to determine a sensible default. Unfortunately it's not possibile to change these default in the first place - due to a form API bug.

fago’s picture

I've found a better workaround for the formAPI bug, so now one can change the default even on action creation.

fago’s picture

Status: Active » Fixed

documented the whole problem https://more.zites.net/workflow-ng/node_insert_redirect and the new #redirect property for events http://drupal.org/node/156798

Anonymous’s picture

Version: 5.x-1.3 » 5.x-1.x-dev

I'm getting a error when using workflow-ng to page-redirect. Originally the error occurred on a drupal 5.3 with a great number of modules added. However I just tested on 5.5 clean with only token and workflow-ng installed as extra, and received the same error. Here is the error:

* warning: array_keys() [function.array-keys]: The first argument should be an array in /Volumes/Lang_Data_300GB/WebServer/Documents/anvill/sites/all/modules/workflow_ng/workflow_ng/workflow_ng.module on line 503.
* warning: Invalid argument supplied for foreach() in /Volumes/Lang_Data_300GB/WebServer/Documents/anvill/includes/common.inc on line 1314.
* warning: Invalid argument supplied for foreach() in /Volumes/Lang_Data_300GB/WebServer/Documents/anvill/sites/all/modules/workflow_ng/workflow_ng/workflow_ng.module on line 507.

I have the dev version installed, and the redirect now works, but it gives me this error message. My php skills are limited, and I wasn't able to quickly figure out the problem.

fago’s picture

YLC, please open another issue for this problem. Be sure to run update.php after upgrading workflow-ng and export your configuration if the problem persists.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.