Hey folk,

I don't know that this exact issue has been araised or not but i didn't find. I am sorry if i am duplicating...

I just want to redirect the user to my custom profile page after successful login attempt. I already have tried "login_destination-6.x-2.3" and "logintoboggan-6.x-1.5.tar.gz". These modules works great withour ajax_register. But when i enable ajax_register module, they stopped working...

I just want to know an alteration in module's code that can get me out of this issue...

Comments

haroon373’s picture

Seems like someone doesn't want to answer this post... :P

No problem!

I sort it out by myself

i have make some changes in ajax.module file and ajax_regiter.module file

FILE: sites/all/module/ajax/ajax.module

/**
 - Resolve the problem of redirection after login.
*/

CHANGE1:
--------
Line: ~328
- if (array_key_exists('redirect', $form_state) && !empty($form_state['redirect'])) {
- 	$data['redirect'] = $form_state['redirect'];
- }

+ if(array_key_exists('#redirect', $form) && isset($form['#redirect'][0])){
+	$data['redirect'] = $form['#redirect'][0];
+ }else if (array_key_exists('redirect', $form_state) && !empty($form_state['redirect'])) {
+	$data['redirect'] = $form_state['redirect'];
+ }


FILE: sites/all/module/ajax_register/ajax_register.module

/**
 - Add form redirect paramter to take the user to the specific page.
 - Its working before so patch is applied in very previous change (CHANGE1).
*/

CHANGE2:
--------
Line: ~74
+ $form['#redirect'] = array('myProfile');

i don't know how to write or make patch
That's why i wrote in layman style...
hope this will help someone..

questions and queries are welcomed

compujohnny’s picture

Status: Active » Closed (won't fix)

This is not an issue with the Ajax Login/Register its an issue of the Ajax module

ha5bro’s picture

haroon373's fix worked for me, temporarily.