Make WordPress Core

Opened 14 years ago

Closed 13 years ago

#15306 closed defect (bug) (fixed)

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

Reported by: ocean90's profile ocean90 Owned by: nacin's profile 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 14 years ago.
15302.2.patch (535 bytes) - added by SergeyBiryukov 13 years ago.
15306.ms.patch (589 bytes) - added by ocean90 13 years ago.
15306.3.patch (623 bytes) - added by SergeyBiryukov 13 years ago.

Download all attachments as: .zip

Change History (18)

#1 @nacin
14 years ago

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

Not a regression, so moving to future now.

@Utkarsh
14 years ago

#2 @Utkarsh
14 years ago

  • Cc admin@… added

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

#3 @demetris
14 years ago

  • Cc dkikizas@… added

#4 @SergeyBiryukov
14 years ago

  • Keywords has-patch added; needs-patch removed

#5 follow-up: @r19
14 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.

#6 @ocean90
13 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

#7 in reply to: ↑ 5 @SergeyBiryukov
13 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.

#8 @nacin
13 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.

#9 @nacin
13 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Multisite has some quirks here. Looking into it.

@ocean90
13 years ago

#11 @goto10
13 years ago

  • Cc dromsey@… added

#12 @SergeyBiryukov
13 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.

#13 @nacin
13 years ago

  • Keywords needs-patch added; has-patch removed

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

#14 @nacin
13 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.