Trigger onBeforeFormLoad is working properly?

vipzeus

Member
I have a form "userdetails" where registered user can add the billing informations.

This form has juser plugin and php code on before form load.
PHP:
$user = JFactory::getUser();
$db = JFactory::getDbo();
$userid = $user->get('id');
$db->setQuery("SELECT * FROM userdetails WHERE userid = '$userid'");
$row = $db->loadResult();
if (empty($row)) {
   $db->setQuery("INSERT INTO userdetails (userid) VALUES ($userid)");
   $db->query();
}
With this code i insert the userid correctly but user informations as email, password, loading after page refresh.
That just for the first time. Next times load correctly as userid existing.

My question is:
The trigger onBeforeLoad must create first the userid and then load all data email, password, username ecc (thanks juser plugin) ?

If not, how i can resolve this problem?
 
Sorry about the delay, I got sick, spent the last two days in bed. Need to set up a test case for this here. I think I know what may be happening, but need to walk through the code.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top