-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If the post_author is a deleted user, change it to a specified user #270
base: master
Are you sure you want to change the base?
Conversation
Posts having post_author ids that refer to deleted users cause problems - even if co-authors is populated. In the short term, don't attempt to resolve the author, and independently find posts with a) deleted authors b) populated co-authors and switch them to be user 0
@leedxw Is there a known way to recreate the issue this fixes? Without this fix, I've tried authoring a post, and then removing the post author from the database entirely, but the page still renders just with an empty author. I do see a PHP warning in the logs:
Is the intention of this fix to address that warning? |
It addresses this warning, but you'll also see a perpetual spinner under "Authors" if you edit the page. |
(I suspect there are other issues related to posts that have owners for which lookups fail.) |
Note that we shouldn't apply this to production until we have reassigned the existing deleted-author posts to an existing author. This output is intended to explain future issues from deleted users. |
3c64b91
to
10ca0ea
Compare
Sets the post_author to 2 if the actual post_author is not found
10ca0ea
to
d5733b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get the intention, but I'm nervous about the approach. Hardcoding a user ID like this that depends on the correct database entry being in place feels risky to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See Rob's comments
1d79929
to
788cabd
Compare
Posts having post_author ids that refer to deleted users cause problems - even if co-authors is populated.
In the short term, don't attempt to resolve the author, and independently find posts with
a) deleted authors
b) populated co-authors
and switch them to be an archive user