Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#18213 closed defect (bug) (fixed)

Error while trying to install theme

Reported by: stevenl's profile SteveNL Owned by: dd32's profile dd32
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.2.1
Component: Warnings/Notices Keywords:
Focuses: Cc:


If I try to install a theme through the admin interface of WordPress I get the following error message:

"Warning: Invalid argument supplied for foreach() in /home/*mydomain*/domains/*mydomain*.com/public_html/wp-admin/includes/theme-install.php on line 265"

Since I didn't do anything with this file I assume it's a bug.

Change History (6)

#1 @dd32
12 years ago

The common reason for this is a archive structure which is incompatible with what WordPress expects.

Can you link to/attach the archive in question? (Or you can email it to me: wordpress [at]

Quite possibly a duplicate of #14999 (Rejecting invalid archives up front will prevent such notices being hit)

#2 @dd32
12 years ago

  • Keywords reporter-feedback added

#3 @SteveNL
12 years ago

What do you mean with attaching the archive? Do you want me to attach the theme I'm trying to install? I have to say, though, that this error message occurs with any theme I'm trying to install.

#4 @dd32
12 years ago

  • Component changed from Upgrade/Install to Warnings/Notices
  • Keywords reporter-feedback removed
  • Milestone changed from Awaiting Review to 3.3

Sorry, I've assumed this was happening when you were attempting to upload a Theme zip file.

Looking closer, I can see where it's coming from, If it's a site which has 0 themes currently installed, It'll throw that Notice.

#5 @SteveNL
12 years ago

No problem. ;)

Haha, yes, that quite explains everything since I had indeed 0 themes installed while I was trying to install a theme.

#6 @dd32
12 years ago

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

In [18462]:

Cast $themes to an array to avoid a PHP Warning when there are no themes currently installed. Fixes #18213

Note: See TracTickets for help on using tickets.