First image can be excluded during magmi re-import with no reason. #454
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.