WordPress.org

Making WordPress.org

Opened 2 years ago

Closed 5 months ago

#2532 closed defect (fixed)

Forums: "Most popular topics" view is broken

Reported by: SergeyBiryukov Owned by: netweb
Milestone: Q1 Priority: normal
Component: Support Forums Keywords:
Cc:

Description

https://wordpress.org/support/view/popular/ appears to be broken: it's supposed to display the list of the most commented topics, but at the moment it just displays the first page of the "All Topics" view.

Works as expected on https://ru.wordpress.org/support/view/popular/ though, so I guess it might be a result of performance optimizations specific to the English forums.

Change History (10)

#1 @SergeyBiryukov
2 years ago

Caused by these two lines, introduced in [3903].

  • Would it be possible to remove $r['orderby'] = 'ID'; for "Most popular topics" view?
  • Is it necessary for this view to be limited to the last six months?

The first item should make the view at least somewhat accurate.

Last edited 2 years ago by SergeyBiryukov (previous) (diff)

#2 follow-up: @ocean90
2 years ago

Can you provide the SQL query which bbPress would perform?

#3 in reply to: ↑ 2 @SergeyBiryukov
2 years ago

Replying to ocean90:

Can you provide the SQL query which bbPress would perform?

Currently:

SELECT SQL_CALC_FOUND_ROWS wporg_419_posts.ID FROM wporg_419_posts INNER JOIN wporg_419_postmeta ON ( wporg_419_posts.ID = wporg_419_postmeta.post_id ) WHERE 1=1 AND wporg_419_posts.post_parent NOT IN (21261,21262,21272) AND ( 
wporg_419_postmeta.meta_key = '_bbp_reply_count'
) AND wporg_419_posts.post_type = 'topic' AND (wporg_419_posts.post_status = 'publish' OR wporg_419_posts.post_status = 'closed' OR wporg_419_posts.post_status = 'private' OR wporg_419_posts.post_status = 'hidden') AND ( wporg_419_posts.ID >= 1 ) GROUP BY wporg_419_posts.ID ORDER BY wporg_419_posts.ID DESC LIMIT 0, 15

With those lines removed:

SELECT SQL_CALC_FOUND_ROWS wporg_419_posts.ID FROM wporg_419_posts INNER JOIN wporg_419_postmeta ON ( wporg_419_posts.ID = wporg_419_postmeta.post_id ) WHERE 1=1 AND wporg_419_posts.post_parent NOT IN (21261,21262,21272) AND ( 
wporg_419_postmeta.meta_key = '_bbp_reply_count'
) AND wporg_419_posts.post_type = 'topic' AND (wporg_419_posts.post_status = 'publish' OR wporg_419_posts.post_status = 'closed' OR wporg_419_posts.post_status = 'private' OR wporg_419_posts.post_status = 'hidden') GROUP BY wporg_419_posts.ID ORDER BY wporg_419_postmeta.meta_value+0 DESC LIMIT 0, 15

The query is also performed twice, as bbp_view_query() is called twice during the page load, I wonder if we could get rid of the second query (haven't looked closely yet).

Last edited 2 years ago by SergeyBiryukov (previous) (diff)

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


2 years ago

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


15 months ago

#6 @Clorith
15 months ago

There's no real value in this view, beyond confidence boosts for individuals, so let's just make away with it on the international forums altogether.

#7 @netweb
15 months ago

  • Owner set to netweb
  • Status changed from new to accepted

#8 @tellyworth
5 months ago

#4045 was marked as a duplicate.

#9 @tellyworth
5 months ago

  • Milestone set to Q1

#10 @dd32
5 months ago

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

In 8082:

Forums: Remove the 'Popular' view as it wasn't operational and doesn't make sense to enable from a performance perspective.

Fixes #2532.

Note: See TracTickets for help on using tickets.