Make WordPress Core

Opened 5 years ago

Last modified 5 months ago

#16404 new defect (bug)

WordPress Importer fails to import images

Reported by: wlpdrpat Owned by:
Milestone: WordPress.org Priority: normal
Severity: normal Version: 3.0.4
Component: Import Keywords: reporter-feedback
Focuses: multisite Cc:


WordPress Importer fails to import images and update image src urls when download and import file attachments is checked.

WordPress MS with images in a post via Media using WP image mapping, e.g. image url: http://site.domainname.com/files/2011/01/myimage.jpg
Fails to download, import and update image src url. All image src urls remain intact from the old domain name.

If you change the image source to specific directory rather than the WP uploads directory: e.g. image url:
Images are downloaded and imported to media but it fails to update image src url in posts. All image src urls in posts remain intact from the old domain name.

I tested this on clean install of WP 3.0.4 MultiSite with TwentyTen theme and no other plugins activated.

Change History (9)

#1 @duck_
5 years ago

  • Component changed from General to Import
  • Keywords reporter-feedback added
  • Summary changed from WordPress Importer to WordPress Importer fails to import images

Cannot reproduce with the following set up:

  • WXR file is slightly modified version of the theme test data. So from a WordPress MS subdomain site (WP.com).

Import site:

  • WordPress 3.1-RC3-17365
  • MS subdirectories setup
  • WordPress Importer 0.3-beta6 and 0.2

Translates images from http://wpthemetestdata.files.wordpress.com/2008/06/canola2.jpg to http://local.domain/testsite/files/2011/01/canola2.jpg.

The images on the old site are still accessible, right? Can you give any further details about your set up?

#2 @wlpdrpat
5 years ago

Yes, the images are still available on the old site. When imported to the new site (without changing the image urls) the image urls are not changed and the images are not imported. When you view the site the images are viewable because they are still available on the old site.

If I move the image files to a static location in the install and update the urls in the .xml export file - then when I import the images are imported but the urls to the images are not updated.

I experienced this will 3 different 3.0.4 installs that had varied themes and plugins. So, for testing purposes I created a clean install configured as below and got the same results.

Import site:
WordPress 3.0.4 MS subdirectories setup
WordPress Importer 0.2
Theme: TwentyTen
Plugins: No other plugins activated

Could this be a bug with 3.0.4 that has been addressed with 3.1 as I see you have tested it with 3.1?

#3 @kurtpayne
4 years ago

  • Cc kpayne@… added

Is this still happening? The WordPress importer plugin has been updated to 0.5 and specifically mentions fixes for attachments. WordPress Importer changelog

#4 @greenshady
3 years ago

  • Cc justin@… added

Yes, it's still happening for me. I'm running into trouble importing attachments from one MS blog to another MS blog on the same install (using it to set up theme demos).

#5 @greenshady
3 years ago

I also just tested the theme unit test data into the same MS blog. Most of the attachments were imported (all but 2).

#6 @SergeyBiryukov
3 years ago

  • Milestone changed from Awaiting Review to WordPress.org

#7 @middlesister
10 months ago

I encountered this bug too. Having xdebug on locally, I rececived these errors:

! Strict standards: Redefining already defined constructor for class WXR_Parser_Regex 
in /path/to/website/wp-content/plugins/wordpress-importer/parsers.php on line 408

! Strict standards: Declaration of WP_Import::bump_request_timeout() should be compatible with 
WP_Importer::bump_request_timeout($val) in /path/to/website/wp-content/plugins/wordpress-importer/wordpress-importer.php on line 38

More annoyingly, the xdebug errors gets inserted into the post content. Right before the first image the whole xdebug stacktrace is output with tables and inline styles and everything. Only before the first image. All image paths in post are still pointing to original site. Nothing gets imported to the media library.

This is in a local MS install using subdomains, WordPress 4.1, Wordpress Importer 0.6.1,importing posts into a domain mapped subsite.

Let me know if you want me to post the full stack trace.

#8 @swissspidy
5 months ago

There's already a ticket for the strict standards errors mentioned by @middlesister: #24373

#9 @swissspidy
5 months ago

  • Focuses multisite added
Note: See TracTickets for help on using tickets.