Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in data structure: entity values are mixed #109

Open
mattiaguatta opened this issue Sep 9, 2020 · 8 comments · Fixed by magento/magento2#32904
Open

Error in data structure: entity values are mixed #109

mattiaguatta opened this issue Sep 9, 2020 · 8 comments · Fixed by magento/magento2#32904

Comments

@mattiaguatta
Copy link

hello, have this error when try to import with sample code, Error in data structure: entity values are mixed

why??




use Magento\Framework\App\Bootstrap;
require_once(__DIR__.'/../../app/bootstrap.php');
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); 
$obj = $bootstrap->getObjectManager();

$state = $obj->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');

$importerModel = $objectManager->create('FireGento\FastSimpleImport\Model\Importer');

$productsArray[] = array(
        
                    'sku' => 'firegento-test',
                    'attribute_set_code' => 'Default',
                    'product_type' => 'simple',
                    'product_websites' => 'base',
                    'name' => 'FireGento Test Product',
                    'price' => '14',
                );
                
                
try {
    $importerModel->processImport($productsArray);
} catch (\Exception $e) {
    echo $e->getMessage();
}

@manaftryzens
Copy link

We also have the same issue. Can we have an update on this please?

@stephansteiner
Copy link

Hi, this was causing some head scratches as well. I ran into the same issue and checked it again on an empty Magento 2.4.1 installation and the above example works just fine.
Please make sure that your Magento2 installation doesn't have any attributes that are set as mandatory (or required).
The validation step checks for mandatory attributes (calling validateRow() in vendor/magento/module-catalog-import-export/Model/Import/Product.php) and - if validation fails - it does not create an entry in the importexport_importdata table. A missing entry in the importexport_importdata will be reported as "Error in data structure: entity values are mixed".

@mattiaguatta
Copy link
Author

mattiaguatta commented Nov 18, 2020 via email

@ozanakc
Copy link

ozanakc commented Jan 29, 2021

Hi @mattiaguatta

How did you solve this problem? Is there a missing value that should be inserted into database seperately?

Regards,
Ozan

@AshishBhatia89
Copy link

Hi @stephansteiner Would you please guide us how did you fix the issue. This is a blocker for us now :(. Thanks in advance.

@avstudnitz
Copy link
Member

@AshishBhatia89 You try to activate the configuration setting "Create temporary table for validated import_data". For me it solved a similar problem a couple of years ago.

@mattiaguatta
Copy link
Author

mattiaguatta commented Apr 29, 2021

hello all,

we fix this iusse by pass in the array the url_key. Like this:

	'sku' => 'Productsku',
	'product_type' => 'configurable',
--->	'url_key' => 'url',
	......................

@gerarddevisser
Copy link

gerarddevisser commented Nov 16, 2023

Changing option Stores > Configurations > Services > FastSimpleImport 2 > Database settings > Create temporary table for validated to No fixed it for me in Magento 2.4.6-p3.

The issue was that this module causes \Magento\ImportExport\Model\ResourceModel\Import\Data::getUniqueColumnDataWithIds() to check table importexport_importdata_tmp but this table is not there in the database. Seems like the module lacks to create this table properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants