• Resolved dilinger

    (@dilinger)


    We’ve had this issue for a while, but I’m only now debugging it. We’re running the latest molongui, wordpress, Newspaper theme, etc (plugins are set to auto-update). When a logged-in (non-guest) user leaves a comment, the display name shows up as the post author. You can see an example of it with this comment:

    https://www.theurbanist.org/2021/01/12/sand-point-way-streetcar/#comment-20828

    The post author is Joe Mangan (who is a guest author), and the person leaving the comment is Doug Trumm (who is an administrator user). The profile picture on the comment is correct, and the comment author url is correct (it points to https://www.theurbanist.org/members/dmtrumm/), but the comment author name shows up as Joe Mangan rather than Doug Trumm.

    I looked in the code; the Newspaper theme (and specifically, its td-standard-pack plugin) has a function called td_comment() that has the following:

    <cite><?php comment_author_link() ?></cite>

    Comment_author_link() is a core wordpress function, which calls get_comment_author_link(). The $comment variable is set with get_comment($comment_ID), where $comment_ID is 0. The returned object in $comment contains the has the wrong ‘comment_author’ value but the correct ‘comment_author_url’ value.

    Let me know if there’s anything I should check.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter dilinger

    (@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.

    Thread Starter dilinger

    (@dilinger)

    I was hoping that the latest update (4.2.15) would fix this, but it still happens.

    • This reply was modified 5 years, 3 months ago by dilinger.
    Plugin Author Molongui

    (@molongui)

    Hi @dilinger,

    Thanks for writing in and reporting this issue!

    We have been trying to reproduce the issue you reported following your indications (registered user commenting on a guest post) and we think it is related with the latest version of BuddyPress:

    1) Without BuddyPress active, everything looks fine (name, url and avatar)
    2) With an old version of BuddyPress we had installed, everything looked fine.
    3) With BuddyPress 7.1.0, we experience the issue you described.

    Just wanted to let you know we are working on this. Hopefully we will find a fix soon. Once we do, we will let you know.

    Thread Starter dilinger

    (@dilinger)

    Thank you for investigating!

    Plugin Author Molongui

    (@molongui)

    Hi @dilinger,

    We have been able to fix the issue. However, we would like you to test it so we can be sure it addresses the issue you reported. Do you feel comfortable editing PHP files?

    If you do, please open a support ticket with us here and we will provide the code and instructions to deploy it.

    Thanks!

    Thread Starter dilinger

    (@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.

    Plugin Author Molongui

    (@molongui)

    Hi @dilinger,

    Great! Then, we will include the fix in the next plugin update. I’m closing this ticket now, but feel free to reopen it if anything.

    And thanks so much for reporting the issue and helping us out to test the fix!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Wrong author name showing up for comments’ is closed to new replies.