Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#40975 closed defect (bug) (fixed)

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

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

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 9 years ago.
40975.patch​ (1.1 KB ) - added by SergeyBiryukov 9 years ago.

Download all attachments as: .zip

Change History (8)

@SergeyBiryukov
9 years ago

#1 @SergeyBiryukov
9 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
9 years ago

  • Keywords needs-testing added

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


9 years ago

#4 @jbpaul17
9 years ago

  • Owner set to SergeyBiryukov
  • Status new → assigned

#5 @SergeyBiryukov
9 years ago

  • Resolution → fixed
  • Status assigned → 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
9 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.