XF 2.3 Restoring a deleted user

christisking

New member
A user on my forum was deleted. After manually restoring their data I am faced with the following issue:

In posts, their name at the left is flat black without a hyperlink, and below their name it says "Guest".

I can view and edit their profile in the admin console, their member page works, all their posts are visible, I've double checked their group memberships and permissions, etc.

Their avatar image is visible on their profile page, and when I edit the profile in admin console, but doesn't appear next to their posts.

When I right click their name next to the post and click inspect, I do not see a hyperlink to their profile, or their avatar data.
Screenshot 2024-08-17 at 1.59.30 PM.webp

For other users that ARE working as expected, I see the following (there is much more "stuff"):
Screenshot 2024-08-17 at 2.03.36 PM.webp

I have re-built a few caches but I don't really know how to resolve this (and I would prefer not to break the site in the process).

Can anyone provide some insight into how XF generates the missing information and what I'd need to do to restore it or make it work again?

I sincerely appreciate any & all help. Thank you. :)
 
In order to give back and help others I will explain what I am doing to fix this problem. I am working in Linux/Bash FYI.

First, I pulled a list of all the tables where username=UserName123 and user_id=0 and stored it as a variable $update_tables:

Code:
$ update_tables=`for table in $(mysql xenforo -e 'show tables' | awk '{print $1}');
do out=$(mysql xenforo -e "select * from $table where username = 'UserName123' and user_id = '0'" 2>&1 | egrep -v -e "Unknown column|doesn't exist");
[ -n "$out" ] && echo $table;
done;`

Code:
$ echo "$update_tables";
xf_conversation_master
xf_conversation_message
xf_news_feed
xf_post
xf_thread

Then I just need to replace the user_id with the correct one for my user in only those tables, like this:
Code:
for table in $update_tables;
do mysql xenforo -e "update $table set user_id = replace(user_id, '0', '123') where username = 'UserName123';";
done;

The user now displays correctly in all the places.

Thank you for your help!!
 
Back
Top Bottom