I have a customized user registration form that it supposed to work like this (and in this order):
1- Register new user in default joomla user table
2- Send email to user
3- Automatically log in the user
4- Get the logged in user ID and save it to "relationship" table
5- Redirect user to welcome page.
My problem is that step 4 is saving user ID as 0 to the second table when it is run for the first time. I know the codes in my save data is correct because if I repeat the above steps without logging the user out, it then saves the user ID correctly.
I believe what is happening here is that Step 4 is happening so quick that it is not getting the user ID returned from the database.
How should I fix this problem? Do I need to a pause in the process? How?
I attached a screenshot of the process section and also the save data action for saving the user ID to second table.
Thank you in advance.
1- Register new user in default joomla user table
2- Send email to user
3- Automatically log in the user
4- Get the logged in user ID and save it to "relationship" table
5- Redirect user to welcome page.
My problem is that step 4 is saving user ID as 0 to the second table when it is run for the first time. I know the codes in my save data is correct because if I repeat the above steps without logging the user out, it then saves the user ID correctly.
I believe what is happening here is that Step 4 is happening so quick that it is not getting the user ID returned from the database.
How should I fix this problem? Do I need to a pause in the process? How?
I attached a screenshot of the process section and also the save data action for saving the user ID to second table.
Thank you in advance.