Question

I've added new field call user_type to the users table in joomla 2.5 user component. And updated 'libraries\joomla\user\user.php' file and .xml file for the new filed.

When I register with new filed it will work fine and update the new database field with new form value. But when it call getUser() array that new field value is empty. I just print the array as

$user = JFactory::getUser();
print_r($user);

All other fields have value like below:

JUser Object
(
    [isRoot:protected] => 
    [id] => 231
    [name] => miu
    [usre_type] => 
    [username] => miu
    [email] => s@l.test

Why that usre_type field value not come to the array? Is there any file, getUsre() need to update?

Was it helpful?

Solution

I believe there is a typo.

You added a column in the database table called user_type, however the array displays usre_type. Note the r and the e are the wrong way round.

Check the user.php and .xml file and correct this mistake

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top