WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

#15306 closed defect (bug) (fixed)

Theme names that consist only of numbers won't be listed on themes page

Reported by: ocean90 Owned by: nacin
Milestone: 3.4 Priority: low
Severity: normal Version: 2.9
Component: Themes Keywords: needs-patch
Focuses: Cc:

Description

Name a theme 1234 and then go to the manage themes page. There will be an empty space:
http://grab.by/7cTI
In trunk there is $theme_names = array_keys( $themes ); in class-wp-themes-list-table.php. After array_keys() the name is int(0), before it's string(4) "1234".

I could reproduce it in 2.9 and 3.0 too.

Attachments (4)

15306.patch (526 bytes) - added by Utkarsh 4 years ago.
15302.2.patch (535 bytes) - added by SergeyBiryukov 3 years ago.
15306.ms.patch (589 bytes) - added by ocean90 3 years ago.
15306.3.patch (623 bytes) - added by SergeyBiryukov 3 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 @nacin4 years ago

  • Milestone changed from 3.1 to Future Release
  • Priority changed from normal to low

Not a regression, so moving to future now.

@Utkarsh4 years ago

comment:2 @Utkarsh4 years ago

  • Cc admin@… added

Attached patch changes preserve_keys parameter to be true in the array_splice call.

comment:3 @demetris4 years ago

  • Cc dkikizas@… added

comment:4 @SergeyBiryukov4 years ago

  • Keywords has-patch added; needs-patch removed

comment:5 follow-up: @r194 years ago

i can not locate the file to patch "class-wp-themes-list-table.php" in a 3.0.x installation, but error still exisits.

comment:6 @ocean903 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from Future Release to 3.4
  • Owner set to nacin
  • Status changed from new to reviewing

@SergeyBiryukov3 years ago

comment:7 in reply to: ↑ 5 @SergeyBiryukov3 years ago

  • Keywords has-patch added; needs-patch removed

Replying to r19:

i can not locate the file to patch "class-wp-themes-list-table.php" in a 3.0.x installation, but error still exisits.

15306.patch was for 3.1. Still seems to apply correctly and fixes the issue. Refreshed just in case.

comment:8 @nacin3 years ago

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

In [19980]:

Preserve keys when splitting themes up for pagination. props Utkarsh. fixes #15306.

comment:9 @nacin3 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Multisite has some quirks here. Looking into it.

@ocean903 years ago

comment:11 @goto103 years ago

  • Cc dromsey@… added

@SergeyBiryukov3 years ago

comment:12 @SergeyBiryukov3 years ago

class-wp-ms-themes-list-table.php has a similar array_slice() call. While it doesn't seem to make any difference there, we should probably preserve the keys as well for consistency.

comment:13 @nacin3 years ago

  • Keywords needs-patch added; has-patch removed

We have an array_merge() somewhere in WP_Theme. Let's fix this.

comment:14 @nacin3 years ago

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

In [20481]:

Add arrays together in WP_Theme::get_allowed() to preserve keys (theme names could be numeric). props ocean90, fixes #15306.

Note: See TracTickets for help on using tickets.