Skip to:
Content

bbPress.org

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2588 closed defect (bug) (fixed)

Nested messages are replying to themselves

Reported by: michaelapproved's profile MichaelApproved Owned by:
Milestone: 2.5.4 Priority: normal
Severity: normal Version: 2.3
Component: Component - Replies Keywords: has-patch
Cc:

Description

I recently upgraded from 2.3.2 to 2.5.3 to get nested message replies. The upgrade went well and messages are nesting properly, for the most part. However, there are some messages that seem to be replying to themselves. For example, if a message is numbered 1080, the "_bbp_reply_to" field is also 1080. The "_bbp_reply_to" field should actually be 0.

This seems to happen to top level replies and doesn't happen all the time. I can't repeat the issue myself but I see the buggy replies when I look through the messages.

As a temporary fix, I added code to loop through recent messages and change any messages that have a reply to itself change to 0.

Attachments (3)

2588.diff (679 bytes) - added by netweb 10 years ago.
2588.2.diff (1.9 KB) - added by netweb 10 years ago.
2588.3.diff (4.4 KB) - added by johnjamesjacoby 10 years ago.

Download all attachments as: .zip

Change History (17)

@netweb
10 years ago

#1 @netweb
10 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 2.6
  • Severity changed from major to normal

Confirmed, noticed this in #2586#comment:4

In bbp_update_reply_to the order of arguments passed should be 1. $reply_id 2. $reply_to

The apply filter call was passing these in the incorrect order causing update_post_meta to update _bbp_reply_to with the $reply_to value as the $reply_id.

#2 @netweb
10 years ago

Duplicate: #2397

@netweb
10 years ago

#3 @netweb
10 years ago

Updated patch including repair tool extension of bbp_admin_repair_reply_menu_order introduced in #2586/r2586

Repair tool deletes _bbp_reply_to from wp_postmeta where post_id = meta_value

SELECT * FROM wp_postmeta WHERE meta_key = '_bbp_reply_to' AND post_id = meta_value

This ticket was mentioned in IRC in #bbpress-dev by netweb. View the logs.


10 years ago

#5 @johnjamesjacoby
10 years ago

  • Milestone changed from 2.6 to 2.5.4

#6 @netweb
10 years ago

Repro Steps:

  • Create a topic
  • Create two replies
  • Edit the first reply

Resulting Topic View Display:

  • Topic
  • Reply2
  • Reply1

Expected Topic View Display:

  • Topic
  • Reply1
  • Reply2

#7 @johnjamesjacoby
10 years ago

In 5371:

Indentation clean-up and assignment clarifycation in bbp_get_reply_to(). See #2588.

#8 @johnjamesjacoby
10 years ago

In 5372:

Remove extraneous validation in bbp_get_form_reply_to(). Fixes bug causing _bbp_reply_to field to be incorrectly set as the current $reply_id when editing a reply with no reply_to, which can lead to hierarchy issues. See #2586, #2588. (trunk)

#9 @johnjamesjacoby
10 years ago

In 5373:

Remove extraneous validation in bbp_get_form_reply_to(). Fixes bug causing _bbp_reply_to field to be incorrectly set as the current $reply_id when editing a reply with no reply_to, which can lead to hierarchy issues. See #2586, #2588. (2.5 branch)

#10 @johnjamesjacoby
10 years ago

In 5374:

Update reply position repair tool to delete invalid _bbp_reply_to fields, and tweak name and description. Props netweb. See #2588. (2.5 branch)

#11 @johnjamesjacoby
10 years ago

In 5375:

Update reply position repair tool to delete invalid _bbp_reply_to fields, and tweak name and description. Props netweb. See #2588. (trunk)

#12 @johnjamesjacoby
10 years ago

In 5377:

Introduce bbp_validate_reply_to() function, used to:

  • Validate a parent reply is actually a reply post_type.
  • A reply is not accidentally assigning itself as its own parent.
  • An integer is returned.

Fixes hiesenbug where calls to bbp_get_reply_id() were unexpectedly and occasionally returning the current reply ID rather than 0.

See #2588. (2.5 branch)

#13 @johnjamesjacoby
10 years ago

In 5378:

Introduce bbp_validate_reply_to() function, used to:

  • Validate a parent reply is actually a reply post_type.
  • A reply is not accidentally assigning itself as its own parent.
  • An integer is returned.

Fixes hiesenbug where calls to bbp_get_reply_id() were unexpectedly and occasionally returning the current reply ID rather than 0.

See #2588. (trunk)

#14 @johnjamesjacoby
10 years ago

  • Resolution set to fixed
  • Status changed from new to closed
  • Version changed from 2.5.3 to 2.3

I recently upgraded from 2.3.2 to 2.5.3 to get nested message replies. The upgrade went well and messages are nesting properly, for the most part. However, there are some messages that seem to be replying to themselves. For example, if a message is numbered 1080, the "_bbp_reply_to" field is also 1080. The "_bbp_reply_to" field should actually be 0.

This seems to happen to top level replies and doesn't happen all the time. I can't repeat the issue myself but I see the buggy replies when I look through the messages.

As a temporary fix, I added code to loop through recent messages and change any messages that have a reply to itself change to 0.

Version 0, edited 10 years ago by johnjamesjacoby (next)
Note: See TracTickets for help on using tickets.