EmicoEcommerce / Magento2TweakwiseExport-archived

Magento 2 module for Tweakwise export
Other
6 stars 16 forks source link

Zend_Db_Statement_Exception during export #1

Closed edwinknol-mediact closed 7 years ago

edwinknol-mediact commented 7 years ago

Issue Brief

What is the purpose of this issue? Explain the background context. We're trying to create an export from a Magento 2 environment to Tweakwise with the following shell command: "php bin/magento tweakwise:export"

Environment

Magento Version: Tweakwise Export Version: 1.0.0 Environment: development Third party modules:

Steps to reproduce:

Execute the following command from commandline: "php bin/magento tweakwise:export"

Actual result:

[Zend_Db_Statement_Exception]
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'catalog_category_entity_varchar.entity_id' in 'field list', query was: SELECT catalog_category_entity.entity_id, 0 AS store_id, 'parent_id' AS attribute, catalog_category_entity.parent_id AS value
FROM catalog_category_entity WHERE (catalog_category_entity.created_in <= 1) AND (catalog_category_entity.updated_in > 1) UNION SELECT catalog_category_entity_varchar.entity_id, catalog_category_entity_varchar.store_id, 'name' AS attribute, catalog_categ ory_entity_varchar.value FROM catalog_category_entity_varchar WHERE (attribute_id = '41') AND (store_id = 0 OR store_id = 2) UNION SELECT catalog_category_entity.entity_id, 0 AS store_id, 'path' AS attribute, catalog_category_entity.path AS value F
ROM catalog_category_entity WHERE (catalog_category_entity.created_in <= 1) AND (catalog_category_entity.updated_in > 1) UNION SELECT catalog_category_entity.entity_id, 0 AS store_id, 'level' AS attribute, catalog_category_entity.level AS value FROM catalog_category_entity WHERE (catalog_category_entity.created_in <= 1) AND (catalog_category_entity.updated_in > 1) UNION SELECT catalog_category_entity.entity_id, 0 AS store_id, 'position' AS attribute, catalog_category_entity.position AS value FROM
catalog_category_entity WHERE (catalog_category_entity.created_in <= 1) AND (catalog_category_entity.updated_in > 1) UNION SELECT catalog_category_entity_int.entity_id, catalog_category_entity_int.store_id, 'is_active' AS attribute, catalog_category_enti ty_int.value FROM catalog_category_entity_int WHERE (attribute_id = '42') AND (store_id = 0 OR store_id = 2) ORDER BY entity_id ASC, store_id ASC

[PDOException]
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'catalog_category_entity_varchar.entity_id' in 'field list'

Expected result

vssr commented 7 years ago

I can confirm this error occuring in a Magento 2.1.5 Enterprise store, containing sample data and a few products added via the admin interface. No other extensions installed. We can look into giving you access for debugging purposes, or doing a screensharing session.

error-tweakwise-export

I was able to get the export successfully running on a freshly installed 2.1.5 Community, on my local environment. So far my suspicions for a cause would be:

Fgruntjes commented 7 years ago

Thank you for the issue, we will come back to you asap.

Fgruntjes commented 7 years ago

Fixed with cc98e2b6ca1c68032eeba2f5781d89884442443c

Thnx for the input

mdubbelman commented 7 years ago

Hi, I think there is an error in your fix: In vendor/emico/tweakwise-export/src/Model/Write/EavIterator.php:247 you are checking the edition of the productMetadata. But you are comparing it to CommunityProductMetadata::PRODUCT_NAME and not CommunityProductMetadata::EDITION_NAME. I think it should be: } elseif ($this->productMetadata->getEdition() == CommunityProductMetadata::EDITION_NAME) { Because now it will never match the community edition (which we are running) and will always perform getAttributeSelectEnterprise() which results in an SQL error: [PDOException] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'attribute_table.row_id' in 'on clause'

@Fgruntjes can you please fix this?

mediactbv commented 7 years ago

After upgrading to 1.0.5 on a Magento 2.1.8 store the above error is occuring again.