Closed (fixed)
Project:
Rules
Version:
7.x-2.x-dev
Component:
Rules Engine
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Oct 2010 at 16:21 UTC
Updated:
23 Feb 2011 at 17:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
fagothanks, indeed there was a @todo in the code to fix that. So I fixed it.
Comment #3
RumpledElf commentedI'm using the alpha 3 version and just had a hair tearing out moment that rules simply did NOT work and I must be doing something wrong until I found this issue.
It still doesn't work.
Comment #4
RumpledElf commentedComment #5
pivica commentedI have a same problem, the only difference is that I am using 'After saving new content' event and I want to redirect user to some other page when it submit new content.
Problem is that rules redirection rule is using $GLOBALS to store redirect url, which is OK in most situations, but not for form submit events - most of the times Drupal forms will do it own redirection after form submission (before rules can interfere) and on that next redirected page rules will check should it redirect again but $GLOBALS will also be recreated now so $GLOBALS['_rules_action_drupal_goto_do'] is lost.
Easy solution is to use $_SESSION instead of $GLOBALS like in attached patch.
Comment #6
pivica commentedUnfortinatly #5 is not working for the next case
- Anyonimus user has a right to create a node that is going to moderation (not published) - he can create but can not view this node upon creation.
- On node save everything is going ok until we come to rules_page_build, there drupal_goto($url) will be called with correct $url but then in drupal_goto execution it will be overridden with $_GET['destination'] which somehow magically is set to path of a newly created node.
For now I just did
Ugly, but I need this to work fast and don't have time to investigate more. If I found some other solution later I will post it here.
Comment #7
jyee commentedI'm using alpha 4 and the redirect is still not working. Like the original post, i've tested with a few other actions and they work, just not the redirect.
change from $GLOBALS to $_SESSION as mentioned in #5 worked for me.
Comment #8
Weaver commentedHi all, please see me post at http://drupal.org/node/1024306
I have included very simple instructions to be able to re-create the problem, so hopefully someone with better programming skills than I will be able to address it soon.
pivica's solution seems perfectly logical, lets hope fago can get some time on this one soon as its bugging the hell out of me! :-)
Comment #9
likewhoa commentedpatch in #5 fixes this for me also.
Comment #10
fagoUsing the SESSION is unnecessary complicated and just works around the problem letting the redirect not work in the first place. Anyway, I take a look at it and fixed the problem. See http://drupal.org/node/1024306#comment-4070132.