Skip to content

[2.3] Importing images doesn't work with links #20348

Closed
@RaphaelBronsveld

Description

@RaphaelBronsveld

Preconditions (*)

  1. Magento 2.3.0
  2. PHP 7.1.25

Steps to reproduce (*)

  1. Go to systems -> Data Transfer -> Import and select products.
  2. Download sample file and just import this file. This should work fine. (Validation + import)
  3. Add columns for images: base_image,small_image,thumbnail_image and a image for these columns. For example: i used this image https://laurentvandessel.be/wp-content/uploads/2014/03/placeholder-750x451.png
  4. Validation works fine, import gives me Imported resource (image) could not be downloaded from external resource due to timeout or access permissions in row(s): 1.

Expected result (*)

  1. I expect no errors and images to be linked to the product.

Actual result (*)

  1. screenshot 2019-01-16 at 16 50 20
  2. Image isn't linked to product.

Further Debugging (*)

Magento/CatalogImportExport/Model/Import/Uploader.php , I noticed some changes with how Magento handles file uploads. It seems that the variable $filePath is set twice (L: 184 & L:191), second time the filePath is set; it also uses the $filePath variable again.

  • Value for $filePath (L: 184) (with example image I used above): pub/media/import/placeholder-750x451.png
  • Value for $filePath (L:191) pub/media/import/placeholder-750x451.pngplaceholder-750x451.png

Image from the first value exists, second obviously doesn't. Function _setUploadFile will fail because it will throw an Exception because the image doesn't exist.

Metadata

Metadata

Labels

Fixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Format is validGate 1 Passed. Automatic verification of issue format passed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions