Making WordPress.org

Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#2043 closed defect (bug) (fixed)

Last Post ignores post status

Reported by: clorith's profile Clorith Owned by:
Milestone: Priority: normal
Component: Support Forums Keywords:
Cc:

Description

The "Last Post" column on the forums shows when there was last a reply on a topic.

It does ignore the post status though, so if a post is caught in the Spam or Pending queues the post time from that reply is still displayed even if the user doesn't have access to view queued posts

Attachments (4)

2043.patch (1.4 KB) - added by denisco 8 years ago.
2043_corrected.patch (1.4 KB) - added by denisco 8 years ago.
Corrected invalid method name
2043.2.patch (4.5 KB) - added by SergeyBiryukov 8 years ago.
2043.3.patch (2.8 KB) - added by SergeyBiryukov 8 years ago.

Download all attachments as: .zip

Change History (25)

#1 follow-up: @netweb
8 years ago

Confirmed.

For example the topic https://wordpress.org/support/topic/forum-bugs-and-broken-things/

I just posted a reply to the above topic, after "archiving" the reply the current topic stats are:

3 replies
2 participants
Last reply from: Stephen Edgar
Last activity: 42 seconds ago

Note: The 3 replies, and 2 participants are due to extra instances of replies previously having been removed without counts being updated.

All of which are incorrect, the fix is to after spamming, unapproving, trashing, or archiving a reply in a topic is to allow the appropriate action e.g. bbp_spammed_topic to call bbp_update_topic_walker(), this is standard bbPress behavior but is currently disabled for performance reasons on the wordpress.org/support forums site

See wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-dropin.php#L12
See wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-dropin.php#L187
See wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-dropin.php#L305

#2 in reply to: ↑ 1 ; follow-up: @SergeyBiryukov
8 years ago

Replying to netweb:

Note: The 3 replies, and 2 participants are due to extra instances of replies previously having been removed without counts being updated.

The sidebar also doesn't show the +X hidden link, probably for the same cause?

#3 in reply to: ↑ 2 ; follow-up: @netweb
8 years ago

Replying to SergeyBiryukov:

The sidebar also doesn't show the +X hidden link, probably for the same cause?

No, this is actually because the custom "Archive" status added here on w.org, as such the ?view=all has not been added to take into account this custom status, we'll add that as part of #1984

#4 in reply to: ↑ 3 @SergeyBiryukov
8 years ago

Replying to netweb:

No, this is actually because the custom "Archive" status added here on w.org, as such the ?view=all has not been added to take into account this custom status, we'll add that as part of #1984

#1984 is about the UI, while this is a functionality issue. Created a separate ticket for that: #2171.

@denisco
8 years ago

#5 @denisco
8 years ago

  • Keywords has-patch added

@denisco
8 years ago

Corrected invalid method name

#6 @netweb
8 years ago

  • Keywords needs-patch added; has-patch removed

Thanks @denisco, the pagination should account for both moderators and normal users, each user should see the correct number of replies per page based on their role.

I've a feeling bbPress core might need to be patched to fix this, the custom post status archive touches many things

#7 @denisco
8 years ago

@netweb sorry, but I do not understand your answer in relation to this the ticket.

Position of latest reply gets from meta "menu_order" of topic and bbPress has bbp_update_topic_walker() for update this meta value.
But this walker is currently disabled for performance reasons on the wordpress.org/support forums.
"Last Post" working incorrect if topic has any hidden replies such as spam, pending or archived because meta "menu_order" not updating when reply marked as spam or pending or archived.
If you have the possibility, could you please explain more fully how you see the solution to the problem of this ticket. Thank you for your time.

Version 0, edited 8 years ago by denisco (next)

#8 follow-up: @SergeyBiryukov
8 years ago

To summarize, the issue is that some topic metadata (_bbp_last_reply_id, _bbp_last_active_id, _bbp_last_active_time, _bbp_reply_count) is missing or inaccurate since bbp_update_topic_walker() was disabled for performance reasons in [3898].

Looks like there are three potential options:

  1. Use available bbPress hooks to work around the issues caused by inaccurate metadata.
  2. Find a way to update the necessary metadata without using bbp_update_topic_walker().
  3. Investigate and resolve bbp_update_topic_walker() performance issues mentioned in [3898].

The correct long-term solution is probably option 2 or 3.

2043.2.patch implements option 1, just to get the ball rolling:

  • For non-moderators, if the topic has hidden replies, the last reply link, last activity time, last post author, and pagination links all properly account for that.
  • For moderators, those links have view=all appended to them, so when you open the link, hidden replies are displayed as expected.

This adds a few SQL queries on the front end, hopefully less expensive than bbp_update_topic_walker(). I only tested the patch on a small install though.

This ticket was mentioned in Slack in #bbpress by netweb. View the logs.


8 years ago

#10 in reply to: ↑ 8 @SergeyBiryukov
8 years ago

Replying to SergeyBiryukov:

For moderators, those links have view=all appended to them, so when you open the link, hidden replies are displayed as expected.

On second thought, that part probably belongs more in #1984 or #2171. Removed in 2043.3.patch.

This ticket was mentioned in Slack in #bbpress by netweb. View the logs.


8 years ago

This ticket was mentioned in Slack in #forums by sergey. View the logs.


8 years ago

#13 @SergeyBiryukov
8 years ago

Triggered the incorrect replies counts issue recently a couple of times:

  1. Reply to a topic that had no replies, it has 1 reply now.
  2. Edit your reply to fix a typo or something.
  3. Akismet didn't flag the initial post, but flags the edited one for some reason, without updating the replies count.
  4. Once you unspam the post, the topic has 2 replies (+ -1 hidden).

This ticket was mentioned in Slack in #forums by sergey. View the logs.


8 years ago

This ticket was mentioned in Slack in #forums by sergey. View the logs.


7 years ago

#16 @SergeyBiryukov
7 years ago

#1937 was marked as a duplicate.

#17 @SergeyBiryukov
7 years ago

In 5672:

Support Forums: Update topic meta on archiving/unarchiving a reply.

See #2043.

#18 @SergeyBiryukov
7 years ago

In 5673:

Support Forums: Update topic meta on trashing/untrashing, deleting, spamming/unspamming, and approving/unapproving a reply.

See #2043.

#19 @SergeyBiryukov
7 years ago

  • Keywords needs-patch removed
  • Resolution set to fixed
  • Status changed from new to closed

#20 @SergeyBiryukov
7 years ago

In 5674:

Support Forums: Pass correct number of arguments to Dropin::bbp_update_topic() and Dropin::bbp_update_reply().

See #1971, #2043.

#21 @SergeyBiryukov
7 years ago

In 5675:

Support Forums: Update the necessary meta data when editing a topic created before 2017-07-17, as those topics can have potentially inaccurate data.

See #1971, #2043.

Note: See TracTickets for help on using tickets.