Error in Magmi configurable product import with Configurable Item processor

780 views Asked by At

I am trying to import in Magento using Magmi a set of configurable and simple products. I have followed all the necessary steps correctly (I guess) that are described here http://wiki.magmi.org/index.php?title=Configurable_Item_processor.

Here is a test file with data that I load in the importer https://docs.google.com/spreadsheets/d/17_fWYfYmSiXdLYp80P0kafPrFYzwzp7JHGNlHQTM0S4/edit?usp=sharing

Test cases:

  1. Running the import without Configurable Item processor works just fine but does not create the link between the simple products and the configurable ones in backend (which makes perfect sense).

  2. Running with Configurable Item processor with all the combinations of plugin options (Perform simples/configurable link y/n & auto match simples skus before configurable y/n) yields all the time the fallowing errors:

    1 SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'attribute_id' cannot be null -

    2 SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'attribute_id' cannot be null - ERROR ON RECORD #3

The error is triggered by this line of code

INSERT INTO `catalog_product_super_attribute` (`product_id`,`attribute_id`,`position`) VALUES (?,?,?)

that you can find in /plugins/base/itemprocessors/configurables/magmi_configurableprocessor.php:246

I have searched for a solution and found this one http://blog.mdnsolutions.com/index.php/magmi-not-importing-configurable-products/ where actually the guy solved the issue by replacing that line above with:

INSERT INTO `catalog_product_super_attribute` (`product_id`,`attribute_id`,`position`) VALUES (:a,:b,:c)

It is not working.

There is also another question on this issue posted here Magmi Configurable Products Importation however the solution appears to be very "vague".

Working with:

Magento - 1.9.0.1

Magmi - 0.7.20

Configurable Item processor - 1.3.7a

OS is Ubuntu running PHP 5.3.10 & MySQL 5.5.34

2

There are 2 answers

0
PedroKTFC On

Some thoughts based on my experience:

  • Are any of your attributes mandatory? I suggest putting something into the size column for the configurable product.
  • For visibility, I use numeric values. For configurable products it should be 4, for simple products it should be 1 (you don't want them to be visible individually, rather you want them to be visible within the configurable products).
  • Finally, how are you creating your csv files? If just with excel, you may get problems with the encoding and how it separates fields. I run my csv files through openoffice calc to make the files UTF-8 and the text fields are properly handled.
0
Storegrab On

Just ran into the exact same problem. Simples work, but configurables don't even with the exact same information/etc.

As it would turn out if there is a wrong "configurable_attributes" named attribute with a simple it still goes.

Example

_attribute_set,type,configurable_attributes,size_option,color,
"Default",simple,"color,size","Small","Gold"

No error

_attribute_set,type,configurable_attributes,size_option,color,
"Default",configurable,"color,size","Small","Gold"

Error

Turns out "color,size" was not matching to actual attribute names.

Was "color,size_option".

Check your attributes