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

First image can be excluded during magmi re-import with no reason. #454

Merged
merged 1 commit into from
May 27, 2016

Conversation

clemrvt
Copy link
Contributor

@clemrvt clemrvt commented May 27, 2016

When using image items processor, first image is excluded for each products during product re-import (excluded flag is checked).

Visibly, image processor is waiting for fields in their attribute_id order (i. e. images fields before gallery field).
Patch is to make sure it is always the case.

Explanation :
It happens only when UNQ_EAV_ATTRIBUTE_ENTITY_TYPE_ID_ATTRIBUTE_CODE is used by MySql as key to query eav_attribute database in request.

Database KO (before patch):
This can be traced to :
With Mysql EXPLAIN, we have :
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-----------------------+--------+----------------------------------------------------------------------------------+-------------------------------------------------+---------+----------------------------------------+------+-------------+
| 1 | SIMPLE | eav_attribute | ref | UNQ_EAV_ATTRIBUTE_ENTITY_TYPE_ID_ATTRIBUTE_CODE,IDX_EAV_ATTRIBUTE_ENTITY_TYPE_ID | UNQ_EAV_ATTRIBUTE_ENTITY_TYPE_ID_ATTRIBUTE_CODE | 2 | const | 89 | Using where |
| 1 | SIMPLE | catalog_eav_attribute | eq_ref | PRIMARY | PRIMARY | 2 | clemoptimal.eav_attribute.attribute_id | 1 | |
+----+-------------+-----------------------+--------+----------------------------------------------------------------------------------+-------------------------------------------------+---------+----------------------------------------+------+-------------+
UNQ_EAV_ATTRIBUTE_ENTITY_TYPE_ID_ATTRIBUTE_CODE is used as key for catalog_eav_attribute
first image is excluded for each products during product re-import (excluded flag is checked when it should not be checked).

Database OK (before patch). With Mysql EXPLAIN, we have :
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-----------------------+--------+----------------------------------------------------------------------------------+----------------------------------+---------+---------------------------------------+------+-------------+
| 1 | SIMPLE | eav_attribute | ref | UNQ_EAV_ATTRIBUTE_ENTITY_TYPE_ID_ATTRIBUTE_CODE,IDX_EAV_ATTRIBUTE_ENTITY_TYPE_ID | IDX_EAV_ATTRIBUTE_ENTITY_TYPE_ID | 2 | const | 74 | Using where |
| 1 | SIMPLE | catalog_eav_attribute | eq_ref | PRIMARY | PRIMARY | 2 | clembourse.eav_attribute.attribute_id | 1 | |

IDX_EAV_ATTRIBUTE_ENTITY_TYPE_ID is used as key for catalog_eav_attribute. Exclude flag is not checked when it should not be checked.

…sibly image processor is waiting for images fields before gallery fields. Patch is to make sure they are always in the right order
@dweeves dweeves merged commit 7d5ff16 into dweeves:master May 27, 2016
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 this pull request may close these issues.

2 participants