Skip to:
Content

bbPress.org

Opened 15 years ago

Closed 14 years ago

#1319 closed defect (bug) (fixed)

get_topic_author, get_post_author: anonymous handling

Reported by: mr_pelle's profile mr_pelle Owned by:
Milestone: 1.1 Priority: high
Severity: normal Version: 1.1-alpha
Component: Back-end Keywords: has-patch tested
Cc: gautam.2011@…

Description

How to replicate:

Do an anonymous post in an existing topic.

Delete a topic (not the one just created) by a registered user.

Result

In Recently Moderated Items you'll end up having:

"Post on Topic 1 Name by Anomymous User (name linked to /profile)

Topic titled Topic 2 Name started by Anomymous User (name linked correctly to author's profile)

Also

"Topic 2" metadata says started by Anomymous.

If you then delete another topic by a different registered user, it appears in Recently Moderated Items and in bb-admin/topic.php as started by Anonymous (name linked correctly)


get_user_display_name( $topic->topic_poster ) works perfectly for registered users, but returns an empty string in case of anonymous ones.

Gautam thoughts here.

I've tried a couple of ideas, but no results...

Attachments (2)

1319.diff (677 bytes) - added by mr_pelle 15 years ago.
rough-working-patch.diff (1.5 KB) - added by mr_pelle 15 years ago.

Download all attachments as: .zip

Change History (10)

@mr_pelle
15 years ago

#1 @mr_pelle
15 years ago

  • Keywords has-patch added

I've attached a patch that works everywhere but for deleted topics by registered users: the topic itself page displays "by Anonymous", while bb-admin/topics.php displays "Anonymous" or the latest anonymous poster username as topic author.

The root of all evil is bb_get_first_post(), I suppose...

#2 @mr_pelle
15 years ago

  • Keywords has-patch removed

I've tried other options and I can confirm that bb_get_first_post() plays a central role.

Also, in bb-admin/topics.php, topic poster is retrieved in an unconsistent way: line 220-221 via $topic->topic_poster while line 222 via topic_author() BUT at line 205 we've already fetched topic's first post, whom infos could be used instead! =P

#3 follow-up: @mr_pelle
15 years ago

I've found a working patch, but it's a bit rough.. I'll upload it in a moment.

#4 in reply to: ↑ 3 @mr_pelle
15 years ago

  • Keywords has-patch tested added

Replying to mr_pelle:

I've found a working patch, but it's a bit rough.. I'll upload it in a moment.

What I do not like about it are:

1) get_topic() @line 130: is there another way to retrieve it?

2) var names @lines 139,140: yeah, I'm no good at naming... =P

#5 @mr_pelle
15 years ago

OT: is it just my database or bb_topics field topic_last_poster_name is always left empty? 0_o"

#6 @GautamGupta
15 years ago

  • Cc gautam.2011@… added

#7 @johnjamesjacoby
14 years ago

topic_last_poster_name should always have the name of the last poster in that topic. Working on a fix for this now.

#8 @johnjamesjacoby
14 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [2535]) Fixes #1319.

Note: See TracTickets for help on using tickets.