Fixing the "JUser: :_load: Unable to load user with ID: XX" Warning

JUser: :_load: Unable to load user with ID JUser: :_load: Unable to load user with ID

Whenever a Joomla article or category is created, the system records the account that created it. This is useful for content items where we also want to display a link to the user who wrote the article, or for displaying content authored by a specific Joomla user.  The warning message "JUser: :_load: Unable to load user with ID: XX" is telling us that the user with the XX id number could not be loaded, typically because that user has been deleted.

Note that this message is a warning rather than an error, so while it can be annoying and may show notices or warnings it won't break your site. In the future, when users leave your organisation it is better practice to disable their Joomla account rather than to delete it. That prevents this issue from arising again.

Option 1: Add 'created by' user

On the article or category edit screen there is a Publishing tab. Within that there is an options to set or change the user associated with that item. In cases where the original creator user account has been deleted, this is unset and by resetting it to an existing user account the warning will go away. If you have a lot of articles or categories with this warning, it can be tedious to open each and re-assign them to an existing user. Luckily, we have another option to avoid that.

Option 2: Change the user ID of an existing user

If you have hundreds of article and categories which were originally authored by a user that's since been deleted, it would be a huge burden to open each one and re-assign it to an existing user. If there is just one user, or most all of the items are created by one user we can edit that user id to match the user id showing up in the warning. Then the software will find an associated user with the correct id. However, if we have created articles and categories since with the user we want to change, all of those will then throw this same warning. The safest way around this to to create a new user and then change that id to the one in the warning.

Remember to run a backup before making any major changes in Joomla, and especially if you're editing the database directly.

To change the user id you can use the following MySQL query:

UPDATE `databasename`.`#_users` SET `id` = 'xx' WHERE `#_users`.`id` = 'yy';

Where 'databasename' is the name of your database, #_ is replaced by your database prefix, xx is the user ID you see in the warning message and yy is the id of the new user you just created. If you are using phpMyAdmin you can click the editing user ID and change it by typing as seen in the screenshot below.

You may also need to update the #_user_usergroup_map table replacing the xx user ID of the same record that maps the user to the correct user group with this user ID of your new user yy, if the yy user ID does not exist already in this table.

Editing a user ID directly in the database: Unable to load user with ID: XX Error

Option 3: Assign all articles and categories to the user ID of an existing user

If you are comfortable with running MySQL queries directly on your database, instead of changing the user ID of an existing user to one that was deleted (Option 2), we can update the 'created by' fields of all articles and categories in the database to a user ID that still exists. You can see the user ID of existing users in the User management screen at Users > Manage in the ID column.

To update the created by field for articles use the following MySQL query:

UPDATE `databasename`.`#_content` SET `created_by` = 'xx';

To update the created by field for categories use the following MySQL query:

UPDATE `databasename`.`#_categories` SET `created_user_id` = 'xx';

Whichever solution you choose, when you have completed the process, the warning message will disappear because all content items now have a user assigned. No more annoying warning messages!

Having problems? Get a free Joomla assessment from us

 

Last modified onThursday, 16 March 2017 17:52
Joomla Expert

JoomlaExpert offers a full range of specialist Joomla website packages coupled with professional Joomla advice & long term support. With clients based in the UK, Scotland, Republic of Ireland, Northern Ireland, the United States, Canada and and Australia we work with a diverse range of businesses providing world-class Joomla solutions. With specialist partners in Marketing, Graphic Design, Video Production, Hosting & Development, we manage your Joomla projects from end-to-end. 

Dr. Ultan Sharkey (BBLS, MBS, Ph.D.) is an ecommerce consultant specializing in online shopping businesses. He holds a Masters degree in Ecommerce and a PhD in Online Shopping Experience from National University of Ireland Galway where he is also an Adjunct Lecturer in the business school. He also owns www.barefoot.ie, a Joomla based online shop for top-brand fitness equipment. He is also a founding member of the eCommerce Association of Ireland (www.ecai.ie).

Ultan and his team have over 10 years experience with Joomla having worked with it since it forked from the Mambo CMS back in 2005. 

Facebook  Twitter  Linkedin

Need Joomla Help? Get a free professional assessment!

Free Joomla Assessment

Contact us

Need a Joomla Expert?