diff --git a/app/code/Magento/CatalogImportExport/Model/Export/Product.php b/app/code/Magento/CatalogImportExport/Model/Export/Product.php index 1d2b3366d22bd..cac256136e780 100644 --- a/app/code/Magento/CatalogImportExport/Model/Export/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Export/Product.php @@ -929,13 +929,14 @@ protected function collectMultirawData() array_keys($this->_websiteIdToCode), $item->getWebsites() ); - $rowCategories[$item->getId()] = $item->getCategoryIds(); + $rowCategories[$item->getId()] = array_combine($item->getCategoryIds(), $item->getCategoryIds()); } $collection->clear(); $allCategoriesIds = array_merge(array_keys($this->_categories), array_keys($this->_rootCategories)); + $allCategoriesIds = array_combine($allCategoriesIds, $allCategoriesIds); foreach ($rowCategories as &$categories) { - $categories = array_intersect($categories, $allCategoriesIds); + $categories = array_intersect_key($categories, $allCategoriesIds); } $data['rowWebsites'] = $rowWebsites; @@ -1219,6 +1220,7 @@ protected function getCustomOptionsData($productIds) public function filterAttributeCollection(\Magento\Eav\Model\Resource\Entity\Attribute\Collection $collection) { $validTypes = array_keys($this->_productTypeModels); + $validTypes = array_combine($validTypes, $validTypes); foreach (parent::filterAttributeCollection($collection) as $attribute) { if (in_array($attribute->getAttributeCode(), $this->_bannedAttributes)) { @@ -1226,7 +1228,8 @@ public function filterAttributeCollection(\Magento\Eav\Model\Resource\Entity\Att continue; } $attrApplyTo = $attribute->getApplyTo(); - $attrApplyTo = $attrApplyTo ? array_intersect($attrApplyTo, $validTypes) : $validTypes; + $attrApplyTo = array_combine($attrApplyTo, $attrApplyTo); + $attrApplyTo = $attrApplyTo ? array_intersect_key($attrApplyTo, $validTypes) : $validTypes; if ($attrApplyTo) { foreach ($attrApplyTo as $productType) {