Co-Authors-Plus icon indicating copy to clipboard operation
Co-Authors-Plus copied to clipboard

Some author pages empty for some logged in users

Open jtbayly opened this issue 6 years ago • 7 comments

I first posted about this over on Wordpress.org: https://wordpress.org/support/topic/some-author-pages-empty-for-some-logged-in-users/

Now there is another user commenting with the same problem, so I thought I'd post the issue here.

Some authors display as having no posts, but only to logged in users.

For example, while logged in, this page will display “No posts found.” to me: https://example.com/wp-admin/edit.php?author_name=randomauthor1 And if that one doesn’t work for me, then neither does this one: https://example.com/author/randomauthor1/

But randomauthor2 will work just fine.

However, oddly enough, logging in as a different user will change which authors don’t work and which ones do. In fact, we’ve got more than 20 authors, and all but one of the author pages work for me. But another user on the site reports that 5 of them fail to load for him.

And if you’re not logged in, the public author pages seem to work just fine (although that’s hard for me to prove with 100% certainty.)

jtbayly avatar Jul 20 '18 17:07 jtbayly

I'm having more site-wide issues w/ the new version of Co-authors plus. Most author pages on the live site only show one post (even though some guest authors have hundreds). When I'm logged in, I see zero posts, and some of the time I get taken back to the site homepage. I've traced the issue to the SQL query that gets generated when the author page is displayed - it returns zero or one result.

Switching back to version 3.2.2 restores the author pages to their former glory.

It looks like the query filters are doings something funky (even when I've turned off all the other plugins that have a function on posts_where and posts_join filters). I did not try to apply @codemacherUG's fixes yet.

ammist avatar Aug 06 '18 22:08 ammist

Having the same issue.

MastaBaba avatar Aug 27 '18 13:08 MastaBaba

Same here

antonlukin avatar Sep 06 '18 12:09 antonlukin

However, oddly enough, logging in as a different user will change which authors don’t work and which ones do. In fact, we’ve got more than 20 authors, and all but one of the author pages work for me. But another user on the site reports that 5 of them fail to load for him.

Do you know what it is about the logged in user that is causing this query to fail for them? E.g. any reproduction steps? I'm having trouble getting this issue to show up for me.

rebeccahum avatar Oct 24 '18 02:10 rebeccahum

The commit on #580 claims to fix this. I haven't tested it, but from what I've read of all the connected issues, it seems that the logged in user's ID must match the start of the other user's id. If so, a simple way to reproduce would be to create a site where you are ID '1' and then create users until you've got users with id's in the teens (eg user id '13'). From there, assign them content, and then while logged in as user 1 view the author page for user 13.

jtbayly avatar Oct 24 '18 10:10 jtbayly

@jtbayly Thanks for the information, I'll look into this.

rebeccahum avatar Nov 05 '18 17:11 rebeccahum

Great. I'm sure you've noticed that I did test the patch in #580 and that it works for me.

jtbayly avatar Nov 05 '18 18:11 jtbayly