This is driving me nuts. It might be a bug.. I have two redirect rules that trigger after saving new content. One works, one does not. I know the nodeid is correct because on a configurable message I include it and it is correct. The only difference is that the rule that is not redirecting is triggered after content is saved which is created after a node is flagged. I really don't see how that would make a difference since both rules are triggered "after saving new content".

My log is fairly unremarkable but I'll post it anyway..

#

* 83.041 ms Executing the rule "redirect to newly created collaboration time" on rule set "After saving new content"
* 83.159 ms Condition "Created content is collaboration time" evaluated to TRUE.
* 95.26 ms Action execution: "Page redirect"
* 97.213 ms Action execution: "Show a configurable message on the site"
* 97.338 ms Evaluation of "After saving new content" has been finished.

# 99.355 ms Evaluation of "A node has been flagged, under "Flag to create Collaboration"" has been finished.

The configurable message is "The nodeid is 433" which is the correct nodeid. All help greatly appreciated

Comments

tpainton’s picture

Component: Rules Core » Rules Engine
Category: support » bug

I am changing this to a bug report. If I create then save a "collaboration time" node the redirect works just fine. The flag is breaking things.

The problem is hopefully reproducible by doing the following.
1)Create a flag on a node that when flagged creates a new node of different type. This flag is not a global flag. Call this "new node". Add another step in this rule if you like to save this content.
2)Create another rule that triggers on "after saving new content"
3)if new content is "new node" then redirect to that node.

You should not get a redirect.

Retry this process without the flag. Simply create new content of "new node" type and the redirect will work.. of course, you have to redirect to another node or the page simply reloads and you can't tell there has been a redirect so just use some random other nodeid.

For some reason, the flag creation of a node is breaking the process.

tpainton’s picture

Title: No redirect happening. » Solved.

I just solved this problem by changing the flag to "normal link" instead of "javascript" AND setting "Force redirecting to the given path, even if a destination parameter is given" in the redirect options. Having either one of these set differently breaks the process.

Not sure if this is "by design", a "bug", or just me not understanding how it all works!

tpainton’s picture

Title: Solved. » Flag creation of node and redirect problems.

Just changing the title so it helps other find this issue, and workaround.

tpainton’s picture

Just noticed.. My flag link includes &desintation in the url thus justifying why one needs the option to override the destination parameter! So that's by design. Not sure, nor am I capable of solving the javascript issue.

mitchell’s picture

Title: Flag creation of node and redirect problems. » Page redirect when flagging a node
Category: bug » support
Status: Active » Fixed

@#3: I think you were correct to change the flag link to normal instead of javascript. If you were trying to perform any actions behind the scenes, then it wouldn't matter which type of link you used. The page redirect only works when a user is on their way to a page.

If you think any of these processes can be improved, please create another issue and hopefully a patch, but I'm happy you found the functionality you need is currently available.

Status: Fixed » Closed (fixed)

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