Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#40975 closed defect (bug) (fixed)

'Empty Spam' and 'Empty Trash' comment buttons not displayed on mobile

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.8.1 Priority: normal
Severity: normal Version: 4.8
Component: Comments Keywords: has-patch needs-testing
Focuses: administration Cc:

Description

Since [26134], top navigation for list tables is not displayed on mobile, which means that 'Empty Spam' and 'Empty Trash' buttons were only displayed in bottom navigation.

Since [40297], these buttons are not displayed in bottom navigation either (on both mobile and desktop) if there's only one page of comments in Spam/Trash, because $this->extra_items is empty, $this->items ends up empty too in ::display(), so $this->has_items() returns false.

The lack of the button also causes the %s items string to overlap with the search bar, see the screenshot.

If there are two or more pages of comments in Spam/Trash, the buttons are displayed as expected.

Attachments (2)

40975.PNG (4.1 KB) - added by SergeyBiryukov 7 years ago.
40975.patch (1.1 KB) - added by SergeyBiryukov 7 years ago.

Download all attachments as: .zip

Change History (8)

@SergeyBiryukov
7 years ago

#1 @SergeyBiryukov
7 years ago

  • Keywords has-patch added

40975.patch fixes the issue by saving $this->has_items() to a static variable, so that the value is consistent between top and bottom navigation.

Other screens appear to be unaffected, as they don't reset $this->items before displaying bottom navigation.

#2 @jbpaul17
7 years ago

  • Keywords needs-testing added

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


7 years ago

#4 @jbpaul17
7 years ago

  • Owner set to SergeyBiryukov
  • Status changed from new to assigned

#5 @SergeyBiryukov
7 years ago

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

In 41022:

Comments: In WP_Comments_List_Table::extra_tablenav(), save the state of ::has_items() to a static variable, so that the value is consistent between top and bottom navigation.

This prevents "Empty Spam" and "Empty Trash" buttons from disappearing if there's only one page of comments in Spam/Trash.

Fixes #40975.

#6 @SergeyBiryukov
7 years ago

In 41023:

Comments: In WP_Comments_List_Table::extra_tablenav(), save the state of ::has_items() to a static variable, so that the value is consistent between top and bottom navigation.

This prevents "Empty Spam" and "Empty Trash" buttons from disappearing if there's only one page of comments in Spam/Trash.

Fixes #40975.

Merges [41022] to the 4.8 branch.

Note: See TracTickets for help on using tickets.