I have upgraded my Joomla 2.5 to Joomla 3. After edit user, user groups will be empty.

$user = JFactory::getUser();
$groups = $user->groups();

Is there anyone who faced same problem?

I checked by removing overridden files and plugings also. But no luck yet.

=========Update=============== User object

JUser Object
    [isRoot:protected] => 
    [id] => 442
    [name] => test user
    [username] => testr
    [email] => [email protected]
    [password] => hash_code here
    [password_clear] => 
    [block] => 0
    [sendEmail] => 0
    [registerDate] => 2014-02-27 05:26:39
    [lastvisitDate] => 2015-02-24 08:06:47
    [activation] => 
    [params] => {"admin_style":"","admin_language":"","language":"","editor":"","helpsite":"","timezone":""}
    [groups] => 
    [guest] => 0
    [lastResetTime] => 0000-00-00 00:00:00
    [resetCount] => 0
    [requireReset] => 0
    [_params:protected] => Joomla\Registry\Registry Object
            [data:protected] => stdClass Object
                    [admin_style] => 
                    [admin_language] => 
                    [language] => 
                    [editor] => 
                    [helpsite] => 
                    [timezone] => 


I found following same issue but no answers yet - https://stackoverflow.com/questions/26635378/user-groups-is-null-after-editing-user-and-saving


2 Answers 2


I have just checked save method in profile model. There is line as follows. line no 362-363.

    // Null the user groups so they don't get overwritten
$user->groups = null;

I commented out that line. It works fine. I don't know which area will affect after commenting out that line.


I had exactly the same issue which took me quite a long time to realise what had gone wrong. I'm not too sure what had happened but wrote an answer a while back to sort the problem out:

You cannot access the private section of this site

Hope this helps

  • I have added answer but I don't know it is correct answer for that. Can you have a look at it?
    – cha
    Commented Feb 24, 2015 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.