WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 8 months ago

#10653 reopened enhancement

Update comment_author when display_name changes

Reported by: mptre Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Comments Keywords: has-patch needs-testing
Focuses: Cc:

Description

One thing that has bothered me recently is the fact that your previous comments doesn't get updated when your display_name is being updated. Which could cause some confusion. I wrote a function (see attached file for further reference) that takes care of this but I would love to see a similiar feature in the WordPress core.

Attachments (4)

update-comment-author.php (904 bytes) - added by mptre 5 years ago.
comment-template.patch (773 bytes) - added by prettyboymp 5 years ago.
get_comment_author.patch (1.0 KB) - added by apljdi 4 years ago.
garyc40-10653.patch (1.5 KB) - added by garyc40 3 years ago.
refreshed and "rephrased" apljdi's patch

Download all attachments as: .zip

Change History (21)

mptre5 years ago

comment:1 scribu5 years ago

  • Keywords has-patch added; comments author removed
  • Milestone changed from Unassigned to 2.9
  • Summary changed from Update comment_author when display_name changes. to Update comment_author when display_name changes

+ 1 on this.

comment:2 prettyboymp5 years ago

  • Cc mpretty@… added

Instead of updating all the comments on comment update, the get_comment_author function should be using the user's display name if available instead of using automatically using what is in the comments table as the name. see attachment:ticket:10653:comment-template.patch

comment:3 ryan4 years ago

  • Milestone changed from 2.9 to 3.0

comment:4 apljdi4 years ago

I like the idea of having the user's display_name reflected in the user's comments, and I like mpretty's suggestion that this is done dynamically. My only concern is that this could lead to confusion in the comments threads if some kind of tracking isn't implemented. If I change my nickname, set that as a display_name, comment a dozen time, then change my nickname again all of those comments would flip to a new 'user'. It seems to me like the comment_author should be written into the DB as the display_name on the first posting of the comment. After that, should the display_name change, the comment author ought to read something like "CurrentName (originally posted under OldName)".

comment:5 follow-up: Denis-de-Bernardy4 years ago

  • Component changed from General to Comments

http://core.trac.wordpress.org/ticket/5787#comment:3

potential problems:

  • Previously approved comments are changed without admin notification/approval.
  • Discussions on a post are often are in the context of "@display_name"
  • An upset or spammy person could abuse it.

Isn't compatible with WP Mu.

comment:7 scribu4 years ago

  • Keywords close added

Denis, very good points.

Proposing this be closed as wontfix and be left to a plugin.

comment:8 Denis-de-Bernardy4 years ago

  • Milestone 3.0 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

comment:9 in reply to: ↑ 5 ; follow-ups: apljdi4 years ago

Replying to Denis-de-Bernardy:

These objections seem mostly inapplicable here.

http://core.trac.wordpress.org/ticket/5787#comment:3

potential problems:

  • Previously approved comments are changed without admin notification/approval.

In what way? mpretty's patch doesn't update anything it checks for an existing user and uses the display_name if a user is found. Nothing is changed.

  • Discussions on a post are often are in the context of "@display_name"

This was my concern but it is not an issue if changes are flagged as I suggested.

  • An upset or spammy person could abuse it.

This is also not an issue if changes are flagged as I suggested.

Actually, the current setup is prone to spammy abuse. I can comment under one name. Change my display_name and comment again. Because of the 'nickname' field I can do this as many times as I like. This wouldn't be addressed by anything suggested on this thread but it does make the 'spammy abuse' objection ring a little hollow.

Part of the issue here an underlying problem with the display_name feature-- it is inconsistently applied. Leaving things alone perpetuates that inconsistency. That is a mistake.

Isn't compatible with WP Mu.

Valid point. I don't WPMU enough to know what it would take to make it compatible.

Suggesting this be re-opened and solved, possibly (preferably) rolling that solution into a general solution, or set of solutions, to the display_name inconsistency problem.

comment:10 in reply to: ↑ 9 apljdi4 years ago

Actually, the current setup is prone to spammy abuse. I can comment under one name. Change my display_name and comment again. Because of the 'nickname' field I can do this as many times as I like. This wouldn't be addressed by anything suggested on this thread but it does make the 'spammy abuse' objection ring a little hollow.

Not sure what I was thinking here, because using display_name with an "Originally posted as..." flag would partially solve the display_name inconsistency and actually reduce the possibility of 'spammy abuse' already built into the system. It wouldn't be an adequate solution because usernames could 'chain' and it would still be confusing, but even with that effect connecting all the user aliases would still be possible

comment:11 in reply to: ↑ 9 ; follow-up: Denis-de-Bernardy4 years ago

  • Keywords needs-patch added; has-patch close removed
  • Milestone set to 3.0
  • Resolution wontfix deleted
  • Status changed from closed to reopened

Replying to apljdi:

I had only scanned this ticket, having stayed on the discussions on #5787

  • Previously approved comments are changed without admin notification/approval.

In what way? mpretty's patch doesn't update anything it checks for an existing user and uses the display_name if a user is found. Nothing is changed.

Picture the commenter's name gets changed to... mmm (checking my spam), SEO services, Viagra, Pharmacy pills, Yoga tips, whatever...

Isn't compatible with WP Mu.

Valid point. I don't WPMU enough to know what it would take to make it compatible.

Basically, you've as many wpmu comments tables as you've blogs.

The patch in this ticket is better than the ones from other tickets, in that -- contrary to the other ones -- it's dynamic. And your idea of "initially posted by..." makes sense to work around two of lloydbudd's above-mentioned points.

I think it also works around the WPMU issue. Re-opening. Needs a new patch and core dev feedback, though.

comment:12 in reply to: ↑ 11 apljdi4 years ago

Replying to Denis-de-Bernardy:

Picture the commenter's name gets changed to... mmm (checking my spam), SEO services, Viagra, Pharmacy pills, Yoga tips, whatever...

OK. I see what you mean. Its a problem, but it is only a problem with registered users as unregistered commenters can't change anything at all. That mitigates the issue a little, I think, since registered users have to get in with valid email addresses in the first place, which would make the spamming process considerably more time intensive, and registered users can be re-edited by admins. Still a problem though. display_names could be checked against Akismet's database or against the "Comment Blacklist" list in Settings->Discussion (odd to me that WP doesn't include any default values, actually). Also, this scenario is possible as things are right now with some, but not all, Settings->Discussion settings.

I think it also works around the WPMU issue. Re-opening. Needs a new patch and core dev feedback, though.

The patch should be fairly simple. I ought to be able to get to it in the next couple of days.

apljdi4 years ago

comment:13 apljdi4 years ago

  • Keywords has-patch added; needs-patch removed

comment:14 nacin4 years ago

Those strings in the default arguments need to be translatable.

comment:15 nacin4 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 3.0 to Future Release

garyc403 years ago

refreshed and "rephrased" apljdi's patch

comment:16 garyc403 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

comment:17 SergeyBiryukov8 months ago

#25198 was marked as a duplicate.

Note: See TracTickets for help on using tickets.