Hi,
exactly following the steps described in http://drupal.org/node/199254#comment-879384, I created the Action "Forward to URL" (in my case: forward to node/71) which should be triggered by "User logging in"; that simply doesn't work.
Watchdog records that an action has been created (/admin/settings/actions/configure/1); watchdog does also record, that users are logging in; it does *not* record anything about triggers and no failed attemps to forward the user.
I've been looking around for documentation on actions/triggers and watched the screencast but haven't found any additional configuration steps or debugging approaches. Any ideas what's going wrong or suggestions where I could look what's happening?
Thanks & greetings, -asb
Comment | File | Size | Author |
---|---|---|---|
#20 | 286668_redirect_trigger.patch | 2.07 KB | andypost |
#18 | 286668_redirect_trigger.patch | 1.94 KB | andypost |
#12 | test_redirect_login.patch | 2.11 KB | tstoeckler |
#9 | enforce_goto_action_D7.patch | 692 bytes | tstoeckler |
#7 | enforce_goto_action.patch | 706 bytes | miro_dietiker |
Comments
Comment #1
acase CreditAttribution: acase commentedI have had the same problem trying to get my trigger to redirect the url after login...Have you heard any news on this?
Comment #2
asb CreditAttribution: asb commentednope.
Comment #3
kvercruyssen CreditAttribution: kvercruyssen commentedTrigger does work when logging in via /?q=user, not when the loginbox is in a block.
--> it's also a problem in 6.5
Comment #4
tjerkameel CreditAttribution: tjerkameel commentedSo is there a workaround for this?
Comment #5
jvandyk CreditAttribution: jvandyk commentedSee explanation of what's happening here: http://drupal.org/node/321573#comment-1077089
Comment #6
marita93 CreditAttribution: marita93 commentedI just hit this problem in Drupal 6.6.
Comment #7
miro_dietikerIndeed the referred explanation of john explains the situation. See also
http://api.drupal.org/api/function/drupal_goto/6
I think the clear understanding of a redirect action is to override default behaviour. The destination is also being used to supply default workflows.
That's why i'd suggest the enforcement to be done in any case and stop making them overrideable by destination in general.
I know solutions/workarounds are things like form_alter.. But this is about general understanding of "what is an action" and precedence of default action, destination override and trigger action.
Or is this really a matter of contrib to have an action "Redirect to URL (force)"? (Or do we need to make it a feature request for D7?)
To open a third option to johns' i provide a patch to unset REQUEST values in core system.
Comment #8
tstoecklerRerolled for D7. Can be backported to D6 once it is comitted.
Comment #9
tstoecklerOh, and here's the patch.
Comment #10
catchSeems like a good change, but could use a test I think.
Comment #11
tstoecklerI wrote a test for this patch and I got one fail at the very end which proved the bug that this issue is about. Then I applied the patch in #9 and I still got the same fail. So I don't know whether the fail is due to a wrong approach in #9 or whether it's the test.
Therefore I am attaching a patch for trigger.test, in case someone wants to jump in and help.
NOTE: I thought that maybe
drupalLogin
doesn't work with the redirect, but using a workaround didn't work either.ALSO NOTE: This is the first test I wrote (Yay!), so if you've got anything to say to improve the test, bring it on =)
Comment #12
tstoecklerHmm. Maybe it'll work now...
Comment #14
tstoecklerAlso worth noting: I tested the patch in #9 manually and it still works (and it doesn't without it), so very weird.
Comment #15
WolfBenz CreditAttribution: WolfBenz commentedHi all,
I'd like to use this as well... can anyone give me a hint on in what exact release of D6 a solution for this bug will be integrated?
-- Wolf
Comment #16
tstoecklerYou can try the patch in #7 for Drupal 6, but if you want to see it committed to core we must see to get this in Drupal 7 first. As you can read in #11 I tried my best, but am stumped on the failing test. Therefore someone more knowledgable in Drupal than me would need to finish this off. I don't think it's very hard, but it IS over my head.
Comment #17
miro_dietikerHmm... it seems to me like simpletest doesn't support any redirect.. am i wrong?
It only parses the answer of the output. Redirect (header, mega) are actions that possibly would need to be triggered after (explicitly or implicitly).
Could be we even need to extend simpletests' api for this?
Comment #18
andypostdrupal_goto works with $_GET http://api.drupal.org/api/function/drupal_goto/7
Patch with redirect combined from #306662: Add redirect option to site-wide contact forms and user.test
Comment #20
andypostI find no ability to assign an action to "Redirect to URL' trigger because simpletest limitation - DrupalPost() does not allows to post a right form.
page admin/structure/trigger/user have 7 forms and DrupalPost posts into first
This patch with debug() to point that both actions get assigned to same hook but this case needs 'user_login'
Comment #21
andypostWait till #601398: Simpletest does not allow assigning actions to triggers
Comment #24
andypostBot goes crazy... Suppose this bug critical
Comment #25
jrivelli CreditAttribution: jrivelli commentedany news on this? It would be nice if we could use the login block with the url redirect!
Comment #26
andypostStill waiting for someone to fix #601398: Simpletest does not allow assigning actions to triggers
Comment #27
catchLet's get the bug fix in, and the test separately - it's too late in the game to be holding up real bug fixes on test framework bugs. Also this isn't critical, just a regular bug.
Comment #28
andypostMy patch from #20 still works but included test requires simpletest to be fixed first
Comment #29
tannerjfco CreditAttribution: tannerjfco commentedExperiencing the same problem here. Happens with Trigger/Action setup and with triggered action with Rules Module. Patch in #18 works, but patch in #20 doesn't for me.
Comment #30
tannerjfco CreditAttribution: tannerjfco commentedAlso experiencing similar issue with setting up a redirect upon account creation. Patch in #18 got it to redirect correctly, but seems to keep the login process from happening, as the user is directed but access is denied because the user is not logged in.
Comment #31
saifya CreditAttribution: saifya commentedSame here on 6.15. After one-time login and forced password change, Trigger breaks all subsequent login attempts.
Comment #33
andypostDuplicate of #732542: system_goto_action breaks core APIs
Test from #20 moved
Comment #34
metalman CreditAttribution: metalman commentedI had the same problem with the login block not triggering the login trigger. I solved it by borrowing some code from the /user login page and making a custom login block using that. That way, the block and the main login page are basically the same and the trigger works fine.
The code looks like this
This is just a simplified and condensed version of the main login page. It activates the triggers just the way it is supposed to and it looks very much like the original trigger block.
Of course, you need to use Full HTML input and it looks best if you have Line Break Conversion turned off.
Hope this is helpful.
Comment #35
Anonymous (not verified) CreditAttribution: Anonymous commented#9: enforce_goto_action_D7.patch queued for re-testing.
Comment #36
TaKuma-2 CreditAttribution: TaKuma-2 commented#7: enforce_goto_action.patch queued for re-testing.
Comment #37
andypostThis issue still valid for D7 while D8 has no trigger module no more
Comment #38
nishant_k CreditAttribution: nishant_k commented12: test_redirect_login.patch queued for re-testing.