FriendsOfSylius / SyliusImportExportPlugin

Sylius plugin to import / export data
MIT License
118 stars 82 forks source link

Import product reference problem #274

Closed manzikki closed 2 years ago

manzikki commented 2 years ago

Trying to import the sample file (below) with php bin/console sylius:import --details product sylf.csv

Code,Locale,Name,Description,Short_description,Meta_description,Meta_keywords,Main_taxon,Taxons,Channels,Enabled,Price
123456,en_US,Product 1,Description 1,Short description 1,Meta description 1,Meta keywords 1,,,,1,22
222333,en_US,Product 2,Description 2,Short description 2,Meta description 2,Meta keywords 2,,,,1,33

Import fails, checking prod.log:

app.CRITICAL: The mandatory header-keys, "Images_Banner", are missing in the data-set. Found header-keys are "Code, Locale, Name, Description, Short_description, Meta_description, Meta_key
words, Main_taxon, Taxons, Channels, Enabled, Price". Either change the service definition of the processor accordingly
or update your import-data

Ok, let's add a new column:

Code,Locale,Name,Description,Short_description,Meta_description,Meta_keywords,Main_taxon,Taxons,Channels,Enabled,Price,Images_Banner
123456,en_US,Product 1,Description 1,Short description 1,Meta description 1,Meta keywords 1,,,,1,22,
222333,en_US,Product 2,Description 2,Short description 2,Meta description 2,Meta keywords 2,,,,1,33,
php bin/console sylius:import --details product sylf.csv

In TranslatableTrait.php line 60:

  Call to a member function get() on null

This may be related to the table sylius_product_image in the database (below).

But is there any trick to get more debugging or simply to force the import to work and ignore the banner_image?

 describe sylius_product_image;
+----------+--------------+------+-----+---------+----------------+
| Field    | Type         | Null | Key | Default | Extra          |
+----------+--------------+------+-----+---------+----------------+
| id       | int          | NO   | PRI | NULL    | auto_increment |
| owner_id | int          | NO   | MUL | NULL    |                |
| type     | varchar(255) | YES  |     | NULL    |                |
| path     | varchar(255) | NO   |     | NULL    |                |
+----------+--------------+------+-----+---------+----------------+
manzikki commented 2 years ago

Sorry this was because of a config problem.