@@ -94,6 +94,7 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo
94
94
const ERROR_GROUP_PRICE_DATA_INCOMPLETE = 'groupPriceDataIsIncomplete ' ;
95
95
const ERROR_SKU_NOT_FOUND_FOR_DELETE = 'skuNotFoundToDelete ' ;
96
96
const ERROR_SUPER_PRODUCTS_SKU_NOT_FOUND = 'superProductsSkuNotFound ' ;
97
+ const ERROR_MEDIA_DATA_INCOMPLETE = 'mediaDataIsIncomplete ' ;
97
98
98
99
/**
99
100
* Pairs of attribute set ID-to-name.
@@ -182,7 +183,8 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo
182
183
self ::ERROR_INVALID_TIER_PRICE_GROUP => 'Tier Price customer group ID is invalid ' ,
183
184
self ::ERROR_TIER_DATA_INCOMPLETE => 'Tier Price data is incomplete ' ,
184
185
self ::ERROR_SKU_NOT_FOUND_FOR_DELETE => 'Product with specified SKU not found ' ,
185
- self ::ERROR_SUPER_PRODUCTS_SKU_NOT_FOUND => 'Product with specified super products SKU not found '
186
+ self ::ERROR_SUPER_PRODUCTS_SKU_NOT_FOUND => 'Product with specified super products SKU not found ' ,
187
+ self ::ERROR_MEDIA_DATA_INCOMPLETE => 'Media data is incomplete '
186
188
);
187
189
188
190
/**
@@ -693,6 +695,23 @@ protected function _isSuperProductsSkuValid($rowData, $rowNum)
693
695
return true ;
694
696
}
695
697
698
+ /**
699
+ * Check media information
700
+ *
701
+ * @param array $rowData
702
+ * @param int $rowNum
703
+ * @return bool
704
+ */
705
+ protected function _isMediaValid ($ rowData , $ rowNum )
706
+ {
707
+ if (!empty ($ rowData ['_media_image ' ]) && empty ($ rowData ['_media_attribute_id ' ])) {
708
+ $ this ->addRowError (self ::ERROR_MEDIA_DATA_INCOMPLETE , $ rowNum );
709
+ return false ;
710
+ }
711
+
712
+ return true ;
713
+ }
714
+
696
715
/**
697
716
* Gather and save information about product links.
698
717
* Must be called after ALL products saving done.
@@ -1567,6 +1586,7 @@ public function validateRow(array $rowData, $rowNum)
1567
1586
$ this ->_isTierPriceValid ($ rowData , $ rowNum );
1568
1587
$ this ->_isGroupPriceValid ($ rowData , $ rowNum );
1569
1588
$ this ->_isSuperProductsSkuValid ($ rowData , $ rowNum );
1589
+ $ this ->_isMediaValid ($ rowData , $ rowNum );
1570
1590
1571
1591
if (self ::SCOPE_DEFAULT == $ rowScope ) { // SKU is specified, row is SCOPE_DEFAULT, new product block begins
1572
1592
$ this ->_processedEntitiesCount ++;
0 commit comments