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
Comment #1
amitaibuMaybe this is connected?
Comment #2
fagohm, 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.
Comment #3
Coyote commentedThanks. I knew I wasn't crazy. Not about this, anyway. : )
Comment #4
amitaibuMaybe we should set a different weight for the workflow-ng module?
Comment #5
fagoNo 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
Comment #6
amitaibu@Fago,
Help is a bit complicated. How about making this checkbox TRUE by default?
Comment #7
fagohm, that won't work. In cases e.g. on a normal node view - where no page redirect is invoked elsewhere, no redirect would happen!
Comment #8
fagoI'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.
Comment #9
fagoI've found a better workaround for the formAPI bug, so now one can change the default even on action creation.
Comment #10
fagodocumented the whole problem https://more.zites.net/workflow-ng/node_insert_redirect and the new #redirect property for events http://drupal.org/node/156798
Comment #11
Anonymous (not verified) commentedI'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.
Comment #12
fagoYLC, 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.
Comment #13
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.