Trigger for redirect to url action causes email to not be sent after users register

gav240z - December 4, 2008 - 22:53
Project:Actions
Version:5.x-2.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Description

Applies to Drupal Core 5.12

I have discovered that setting a trigger and action to redirect a user to a specific page after registration is causing activation emails not to be sent. Users can't login after signing up.

Is this a known issue? Is there any reason why this would happen?

I hope this is the right place to file such a bug.

#1

gav240z - December 11, 2008 - 11:57

No response, at all? Is this not a core module?

#2

Heine - December 11, 2008 - 12:42

No this is not a core module. (There is a 6.x Action module in core).

Make the weight of the actions module higher in the systems table (UPDATE system SET weight = 10 WHERE name = 'actions') to work around this problem;

Ceterum censeo... ending a request during hook execution is a sin.

#3

gav240z - December 11, 2008 - 13:26

Ok thanks, will give this a try.

Will make database backup first though.

#4

gav240z - December 11, 2008 - 13:40

Nope didn't work, still didn't get email. Only received email after requesting new password.

Clearly its bypassing the send email phase and just going to the redirected url instead :(.

#5

jvandyk - December 11, 2008 - 17:23

#6

jvandyk - December 11, 2008 - 17:32

The short answer to what is happening is that in Drupal 5, the submit handler for the registration form calls user_save() to create the new user. user_save() fires the hook. Then when user_save() is done, execution goes back to the submit handler which sends out the email. So if you are assigning an action to run that does a drupal_goto() when user_save() fires the hook, execution never gets back to the submit handler and thus the email is never sent.

You might also check out http://drupal.org/project/logintoboggan

#7

gav240z - December 11, 2008 - 22:00

Yeah I tried login toboggan but it seemed like overkill for my needs. I honestly didn't want to depend on yet another module if I didn't need it.

It basically means I need to re-theme my login box and make other changes to the site.

Does the same problem occur in Drupal 6? I have been thinking of moving my site over to D6 since CCK and Views is now out for D6.

#8

gav240z - December 15, 2008 - 10:23

Ok Login Toboggan fixed the issue for me. I do like some of the features login toboggan addresses, but I still think the above issue is a bug and not expected behaviour.

How do I go about submitting this issue further?

Can anyone confirm if the same issue exists in Drupal 6?

#9

yaHappyDrupUser - June 14, 2009 - 10:45
Title:Action: Redirect User On Registration Causes Activation Email not to be sent.» Trigger for redirect to url action causes email to not be sent after users register

BTW, Im using Drupal 6.11 and have this problem. To reiterate and for search purposed for other users who may be having trouble finding help: I enabled a trigger to set off a created action that performs a direct to url for a new page i created that say's you have submitted your registration... we sent you an email... yada yada! When a user registers, the temporary account, which is waiting for verification click through from the sent templated email, is created. The email is ready to be fired off. ONce, the registration is for a new account is submitted, the redirect to url.. thanks for registerring does indeed occur. Heres the problem though. The programming logic never gives back control to the emailer which should be run to shoot the email off to the new candidate user. So an account is sitting in the database waiting to be finalized and the receiver left looking for an email that is never coming! haha. Hey you gotta laugh sometimes. I'd get in and get dirty with some php, but I don't have time. I hope this is fixed soon. I'm going to get the module since I hear it fixes the problem. However this needs to be fixed and if I get time, I intend to make a patch for this that calls the templated email emailer function, once the redirect is finished. I thin kthat will fix it. Any developers read this, please this problem is important and beggin for attention. I got a feeling its a quick fix.

#10

wesley_2mpact - July 12, 2009 - 13:33

I've had a similar problem and fixed it with the standard functionality.

My scenario:
After a registered user made a new post I wanted to redirect them to a node showing all their posts instead of the node they just created.
I created an action that goes to an internal Drupal path (node/x) and then set a trigger on node creation to execute this action.
The redirect worked just fine, but the node wasn't saved properly. Half of the fields were not posted, permissions were wrong, ...

The fix:
Before triggering the redirect, I set another trigger to save the node. Everything works fine now.

I'm guessing that you could do something similar with a user registration. Eg saving the user before redirection or something similar.

#11

Onopoc - August 10, 2009 - 00:58

@gav240z: I can confirm this issue with Drupal 6.12.

#12

jasperdc - August 13, 2009 - 09:17

@Onopoc: I've got the exact same problem in Drupal 6.13

#13

arielon - August 26, 2009 - 09:01

Confirmed in Druapl 6.13. Seems a problem in the Trigger module, instead of the Actions one, though.

#14

Onopoc - August 26, 2009 - 15:51
Version:5.x-2.6» 5.x-2.x-dev
Priority:normal» critical

Confirming that this issue is present in Drupal 7.x dev version too. I opened another issue at http://drupal.org/node/560150

Maybe when fixed with Drupal 7 it could be back port to Drupal 5 & 6?

#15

csc4 - August 29, 2009 - 23:43

I'm looking at something similar and wondered if there's a connection with System action (email) triggered by workflow failed because the $node object was not set properly which has a proposed patch in the workflow issue queue from January.

 
 

Drupal is a registered trademark of Dries Buytaert.