On redirect after node creation, node_access entries don't form

Coyote - November 29, 2007 - 22:17
Project:Workflow-ng
Version:5.x-1.x-dev
Component:Documentation
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

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?

#1

Amitaibu - November 29, 2007 - 22:29

Maybe this is connected?

#2

fago - November 30, 2007 - 08:11

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.

#3

Coyote - November 30, 2007 - 15:09

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

#4

Amitaibu - December 10, 2007 - 10:34

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

#5

fago - December 11, 2007 - 22:11
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

#6

Amitaibu - December 12, 2007 - 05:52

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

#7

fago - December 12, 2007 - 09:05
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!

#8

fago - December 12, 2007 - 11:44

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.

#9

fago - December 13, 2007 - 12:19

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

#10

fago - December 13, 2007 - 12:44
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

#11

Nianbei - December 14, 2007 - 05:36
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.

#12

fago - December 18, 2007 - 13:41

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.

#13

Anonymous - January 1, 2008 - 13:42
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.