WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#5468 closed defect (bug) (fixed)

WXR import error when no tags are used

Reported by: fitztrev Owned by:
Milestone: 2.5 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:

Description

When importing a WP Export file, the following error occurs:

Warning: array_shift() [function.array-shift]: The argument should be an array in /home/fitztrev/public_html/trunk/wp-admin/import/wordpress.php on line 238

This was tested between 2 trunk installations, both revision 6381.

Attachments (1)

fitztrev.diff (365 bytes) - added by fitztrev 6 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 fitztrev6 years ago

  • Summary changed from array_shift() Error on WXR Import to WXR import error when no tags are used

This occurs because the 'tags' variable is only casted into an array once a tag has been found. If the blog owner has never used tags before, this causes a problem. This patch initializes the 'tags' variable as an array at the beginning of the import class.

To recreate:

1) Have 2 fresh installations side by side.

2) Export content from 1 WP instance from Manage>Export

3) Import that file on the second WP instance from Manage>Import>WordPress

*) Then try again, but give Hello World a tag.

comment:2 fitztrev6 years ago

  • Keywords has-patch added

fitztrev6 years ago

comment:3 ryan6 years ago

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

(In [6565]) Init tags array. Props fitzrev. fixes #5468

Note: See TracTickets for help on using tickets.