Joomla 3: “JUser: :_load” warning

Yesterday I upgraded a website from Joomla 2.5.6 to 3.0.3 (via 2.5.9 version, upgrade directly was not possible) and this morning I found this warning:

JUser: :_load: Unable to load user with id: 42

Turned out that in a previous upgrade were deleted some users, and the articles assigned to user id 42 in the table *_content (where * stands for the table prefix chosen during the installation process).
I solved assigning those articles to an existing user (in this case the superadmin of this site).

When you are inside the db (with phpmyadmin or heidisql or another interface), it needs to run this query

UPDATE jos_content SET created_by = [existing uid] WHERE created_by=[old uid]

The old uid stands for the uid you read in the warning (in my case was 42), the existing uid can be read into the *_user table (in the id field).

Example, if 123 is a valid user id and 42 the old one, and the prefix is ‘joomla’

UPDATE joomla_content SET created_by = 123 WHERE created_by=42

Leave a comment