WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#18213 closed defect (bug) (fixed)

Error while trying to install theme

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

Description

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)

comment:1 dd323 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] dd32.id.au)

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

comment:2 dd323 years ago

  • Keywords reporter-feedback added

comment:3 SteveNL3 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.

comment:4 dd323 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.

comment:5 SteveNL3 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.

comment:6 dd323 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.