dilinger
Forum Replies Created
-
Oops, it looks like they modified the site and created a real user for Troy. Instead of the above link, use the following instead to see how the bylines are broken:
https://www.theurbanist.org/2021/02/15/st-2040-a-shovel-ready-vision-for-seattle-and-sound-transit/
The guest authors (Ace & Conor) are at the bottom of the page, while the top page byline instead lists Stephen.
I also just tested with the 4.4.1 release, and it’s still broken.
- This reply was modified 2 years, 11 months ago by dilinger.
It’s also worth noting that for normal articles written by Natalie, you can click on her name in the byline at the top. For example, https://www.theurbanist.org/2021/12/02/lynnwoods-city-center-transforming-strip-malls-into-a-dense-urban-neighborhood/ allows you to click on her name to see all of her authored articles. However, since https://www.theurbanist.org/2021/12/03/alternative-light-rail-alignments-into-downtown-tacoma-a-mapped-review/ is not written by her and is actually authored by a guest user, Natalie’s name is not clickable at the top.
When I go into /wp-admin/ and list posts, Troy shows up as the article author with a little “[guest]” by his name. So it seems like this is just a problem with the way guest authors are displayed, rather than any kind of database/backend issue.
- This reply was modified 2 years, 11 months ago by dilinger.
Thanks, the new code does indeed seem to fix it. I haven’t spotted any issues yet with the new code, but if we come across something we’ll let you know.
Thank you for investigating!
I was hoping that the latest update (4.2.15) would fix this, but it still happens.
- This reply was modified 3 years, 10 months ago by dilinger.
Oh, and we’re running page caching (WP Super Cache) but no persistent object cache (Redis plugin is disabled). The problem occurs even if I’m logged in, and we have WP Super Cache disabled for logged in users.
Yes, we’re running the latest plugin and wordpress versions (auto-updates are enabled). This is a live site, so it will take me a little while to set up a dev environment to test out stuff without plugins.
I realized that I screwed up that last test. The problem is with normal, not guest users. So reproducing:
1. New post (as me, user id 122), save as a draft. Currently the posts table with post_author of 122, and postmeta table author fields as ‘user-122’.
2. Go back to the draft post, delete my authorship, add Futurewise (user id 113) as the author. Save draft. At this point, the posts table has a post_author of 122, and postmeta table author fields are ‘user-113’.
3. Publish. Now on the main page the post author says “Futurewise” but the link is to my author page.
This *only* happens with some users. It seems like the difference between the users that work properly and the ones that don’t are whether the user is an “Author” or a “Contributor”.
If I set a user (let’s call them “Frank”) role as Author, and then edit the post and set Frank as the author: the post_author field in the posts table contains 122 (me) and the link is incorrect. If I then edit the post to set the author back to me, set Frank’s role as a Contributor, and then edit the post again to set the author to Frank: the post_author field in the posts table contains Frank’s ID and the link is correct.
So it seems to only happen for users whose role is Author.
Okay, I was able to reproduce it. I created a new post as my own user (122), and saved a draft. At this point the posts table had a post_author of ‘122’, and the postmeta table had ‘user-122’ for _molongui_author/_molongui_main_author.
Then I went back into the post to edit it, deleted myself as an author, and selected a guest author from the author pulldown list. Then I saved a draft. At this point, the posts table *still* had a post_author of ‘122’, while the postmeta table has ‘guest-97710’ for _molongui_author/_molongui_main_author. Now they’re out of synch, and if I publish the link will be wrong.
I tried what you suggested.
First, I removed the author and replaced it with another guest user (_molongui_main_author and _molongui_author as ‘guest-97710’ in the postmeta table). However, in the posts table, post_author is still set to ‘6’.
This saved properly, so I went on to step #4
I removed the user and re-added the 113 user, and saved it. Now the postmeta table has _molongui_main_author and _molongui_author as ‘user-113’, and the posts table has post_author as ‘113’. Now when I view the main page (well, 3rd page at this point), the byline links to the correct author page.
Let me see if I can figure out how to reproduce this when creating a new post…
By the time someone looks into this the post that I highlighted will probably have shifted as new posts are made, but there are other posts where this is happening as well. For example, the https://www.theurbanist.org/2020/09/18/cascadia-needs-to-change-its-ways-to-keep-from-burning-up/ byline link should go to /author/editorial/ but instead goes to /author/dmtrumm/ when viewed from https://www.theurbanist.org/.