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.

Comments

gav240z’s picture

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

Heine’s picture

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.

gav240z’s picture

Ok thanks, will give this a try.

Will make database backup first though.

gav240z’s picture

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 :(.

jvandyk’s picture

jvandyk’s picture

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

gav240z’s picture

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.

gav240z’s picture

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?

yaHappyDrupUser’s picture

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.

weseze’s picture

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.

Francewhoa’s picture

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

jasperdc’s picture

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

ari-meetai’s picture

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

Francewhoa’s picture

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?

csc4’s picture

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.

vitis’s picture

sub

josuealcalde’s picture

subscribe

Will Igetit’s picture

sub

Pomliane’s picture

Status: Active » Closed (won't fix)

This version of Actions is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.