Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
Everytime I try to import products, I receive the following error:
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /Applications/MAMP/htdocs/dev-store/includes/entity.inc).
Notice: Trying to get property of non-object in file_field_presave() (line 220 of /Applications/MAMP/htdocs/dev-store/modules/file/file.field.inc).
Notice: Undefined property: stdClass::$uri in file_save() (line 570 of /Applications/MAMP/htdocs/dev-store/includes/file.inc).
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /Applications/MAMP/htdocs/dev-store/includes/entity.inc).
Notice: Trying to get property of non-object in image_field_presave() (line 236 of /Applications/MAMP/htdocs/dev-store/modules/image/image.field.inc).
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /Applications/MAMP/htdocs/dev-store/includes/entity.inc).
Notice: Trying to get property of non-object in file_field_presave() (line 220 of /Applications/MAMP/htdocs/dev-store/modules/file/file.field.inc).
Notice: Undefined property: stdClass::$uri in file_save() (line 570 of /Applications/MAMP/htdocs/dev-store/includes/file.inc).
Here's my importer:
$feeds_importer = new stdClass();
$feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */
$feeds_importer->api_version = 1;
$feeds_importer->id = 'products_regular_update';
$feeds_importer->config = array(
'name' => 'Products regular update',
'description' => 'Regular update of the products.',
'fetcher' => array(
'plugin_key' => 'FeedsFileFetcher',
'config' => array(
'allowed_extensions' => 'txt csv tsv xml opml',
'direct' => FALSE,
),
),
'parser' => array(
'plugin_key' => 'FeedsCSVParser',
'config' => array(
'delimiter' => ',',
'no_headers' => 0,
),
),
'processor' => array(
'plugin_key' => 'FeedsCommerceProductProcessor',
'config' => array(
'product_type' => 'product',
'author' => '1',
'tax_rate' => TRUE,
'mappings' => array(
0 => array(
'source' => 'SKU',
'target' => 'sku',
'unique' => 1,
),
1 => array(
'source' => 'Quantity',
'target' => 'commerce_stock',
'unique' => FALSE,
),
2 => array(
'source' => 'Regular Price',
'target' => 'commerce_price:amount',
'unique' => FALSE,
),
3 => array(
'source' => 'Sale Price',
'target' => 'field_sale_price:amount',
'unique' => FALSE,
),
4 => array(
'source' => 'Non-Set Price',
'target' => 'field_non_set_price:amount',
'unique' => FALSE,
),
5 => array(
'source' => 'Product ETA Note',
'target' => 'field_backorder_message',
'unique' => FALSE,
),
),
'update_existing' => '2',
'input_format' => 'plain_text',
'skip_hash_check' => 0,
),
),
'content_type' => '',
'update' => 0,
'import_period' => '3600',
'expire_period' => 3600,
'import_on_create' => 1,
'process_in_background' => 1,
);
Comments
Comment #1
barraponto CreditAttribution: barraponto commentedThis is probably an issue with Commerce Feeds, moving to appropriate queue.
Comment #2
pcambraCan you provide a test file to reproduce this problem?
Comment #2.0
pcambraremove note about csv attached
Comment #3
akosipax CreditAttribution: akosipax commentedSeems like this is no longer a problem.