I have created Importer to load products into commerce module from xml file. Mappings and xpath query are configured. But I get an error message

Warning: strpos() expects parameter 1 to be string, array given в функции commerce_product_validate_sku() (строка 686 в файле D:\OpenServer\domains\drupal7\sites\all\modules\commerce\modules\product\commerce_product.module).

I have been tried to investigate this problem myself but I have not enough experience in Drupal.

The problem is reproduced only if the xml document contains more than one items to import. If only one item in the xml file import succeeds.

I have attached screenshot which explains the entity object. I'm not sure maybe this is XPath XML parser problem.

CommentFileSizeAuthor
img1.jpg122.86 KBepashkov
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

twistor’s picture

Project: Feeds » Commerce Feeds
Version: 7.x-2.0-alpha7 » 7.x-1.x-dev
Component: Feeds Import » Code
Priority: Critical » Normal

It looks like your mapping a multiple values to a single-valued field. Not sure what the exact problem is, but it should probably be validated.

LaFabrik’s picture

Issue summary: View changes

Same problem,
the xml parser make arrays that can't be import.
The only solution is to make your import without this module (use only feeds and feeds tamper eventually).
The xml is well parse and import multiples products.