WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#16196 closed defect (bug) (fixed)

"Available themes" is empty/confusing when there are no other themes installed

Reported by: solarissmoke Owned by:
Milestone: 3.1 Priority: normal
Severity: minor Version: 3.1
Component: Themes Keywords: has-patch commit
Focuses: Cc:

Description

When there are no alternative themes installed, wp-admin/themes.php just has <h3>Available Themes</h3> followed by an empty table. I think this can be a bit confusing (and it looks a bit weird as well).

It might be better to say something like "you have no other themes installed at the moment. You can [link to theme-install.php] search for themes here." And to not create an empty table.

Attachments (9)

16196.patch (564 bytes) - added by solarissmoke 5 years ago.
Don't show empty "available themes" table, and link to theme-install.php
garyc40.16196.diff (1.7 KB) - added by garyc40 5 years ago.
use display_rows_or_placeholder() for themes-list-table and theme-install-list-table, also fixed some css inconsistencies in theme-install-list-table
before.png (21.6 KB) - added by garyc40 5 years ago.
before css and display_rows_or_placeholder() fix
after.png (23.8 KB) - added by garyc40 5 years ago.
after css and display_rows_or_placeholder() fix
garyc40.16196.2.diff (2.9 KB) - added by garyc40 5 years ago.
also fix empty (hidden) tablenav on themes.php when total_pages <= 1
before garyc40.16196.2.png (107.1 KB) - added by garyc40 5 years ago.
tablenav was output but display:none with height:30px
after garyc40.16196.2.png (100.3 KB) - added by garyc40 5 years ago.
removed tablenav altogether when total_pages <= 1
16196.diff (404 bytes) - added by nacin 5 years ago.
Sad panda.
16196.2.diff (3.4 KB) - added by solarissmoke 5 years ago.

Download all attachments as: .zip

Change History (18)

@solarissmoke5 years ago

Don't show empty "available themes" table, and link to theme-install.php

comment:1 @solarissmoke5 years ago

  • Keywords has-patch dev-feedback added

@garyc405 years ago

use display_rows_or_placeholder() for themes-list-table and theme-install-list-table, also fixed some css inconsistencies in theme-install-list-table

@garyc405 years ago

before css and display_rows_or_placeholder() fix

@garyc405 years ago

after css and display_rows_or_placeholder() fix

@garyc405 years ago

also fix empty (hidden) tablenav on themes.php when total_pages <= 1

@garyc405 years ago

tablenav was output but display:none with height:30px

@garyc405 years ago

removed tablenav altogether when total_pages <= 1

comment:2 @dd325 years ago

  • Keywords 3.2-early added; dev-feedback removed
  • Milestone changed from Awaiting Review to Future Release

3.2 may include a review of the UI screens related to this

comment:3 follow-up: @nacin5 years ago

  • Keywords 3.2-early removed
  • Milestone changed from Future Release to 3.1

The main thing here is a regression. The code was written and is in the list table no less.

Please see my attached patch (I found this ticket after) for my simple fix, at least.

@nacin5 years ago

Sad panda.

comment:4 in reply to: ↑ 3 @solarissmoke5 years ago

Do we still need to print an empty table at the bottom - or could we move $wp_list_table->display(); to before the elseif ?

comment:5 follow-up: @nacin5 years ago

We would need to check to make sure it's not a search I think -- see the start of that. I didn't dig too deep into the logic, I just remember doing all the strings in no_items() and was very surprised to not see them echo'd.

I don't even want to check what happens when a search returns no results. It looks like no_items() gets called, and no_items() currently doesn't take into account searching and the like. :-(

comment:6 in reply to: ↑ 5 @solarissmoke5 years ago

Replying to nacin:

This patch sorts out those issues and I think it is consistent with the generic behaviour of WP_List_Table. The output of no_items() looks a bit funky IMO, but that is a styling issue which garyc40 has provided a suggestion for. I've consolidated all into one patch.

Last edited 5 years ago by solarissmoke (previous) (diff)

@solarissmoke5 years ago

comment:7 @garyc405 years ago

Checked all other outputs of no_items(). Seems like WP_Themes_List_Table is the only one we need to account for searching.

comment:8 @nacin5 years ago

  • Keywords commit added

Patch tested and looks good. And thanks Gary for checking.

comment:9 @ryan5 years ago

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

(In [17303]) Improve presentation when there are no available themes. Props solarissmoke, garyc40. fixes #16196

Note: See TracTickets for help on using tickets.