Skip to content

Commit

Permalink
MAGETWO-94671: Product Export fails
Browse files Browse the repository at this point in the history
  • Loading branch information
vzabaznov committed Oct 11, 2018
1 parent 1766f07 commit 5681284
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions app/code/Magento/CatalogImportExport/Model/Export/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,13 @@ class Product extends \Magento\ImportExport\Model\Export\Entity\AbstractEntity
private $productEntityLinkField;

/**
* Product constructor.
* @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
* @param \Magento\Eav\Model\Config $config
* @param \Magento\Framework\App\ResourceConnection $resource
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Psr\Log\LoggerInterface $logger
* @param \Magento\Catalog\Model\ResourceModel\Product\Collection $collection
* @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $collectionFactory
* @param \Magento\ImportExport\Model\Export\ConfigInterface $exportConfig
* @param \Magento\Catalog\Model\ResourceModel\ProductFactory $productFactory
* @param \Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory $attrSetColFactory
Expand All @@ -363,10 +364,10 @@ class Product extends \Magento\ImportExport\Model\Export\Entity\AbstractEntity
* @param \Magento\Catalog\Model\ResourceModel\Product\Option\CollectionFactory $optionColFactory
* @param \Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory $attributeColFactory
* @param Product\Type\Factory $_typeFactory
* @param \Magento\Catalog\Model\Product\LinkTypeProvider $linkTypeProvider
* @param \Magento\CatalogImportExport\Model\Export\RowCustomizerInterface $rowCustomizer
* @param ProductEntity\LinkTypeProvider $linkTypeProvider
* @param RowCustomizerInterface $rowCustomizer
* @param array $dateAttrCodes
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function __construct(
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
Expand Down Expand Up @@ -695,7 +696,9 @@ protected function updateDataWithCategoryColumns(&$dataRow, &$rowCategories, $pr
}

/**
* {@inheritdoc}
* Get header columns
*
* @return string[]
*/
public function _getHeaderColumns()
{
Expand Down Expand Up @@ -754,7 +757,10 @@ protected function _getExportMainAttrCodes()
}

/**
* {@inheritdoc}
* Get entity collection
*
* @param bool $resetCollection
* @return \Magento\Framework\Data\Collection\AbstractDb
*/
protected function _getEntityCollection($resetCollection = false)
{
Expand Down Expand Up @@ -861,7 +867,10 @@ public function export()
}

/**
* {@inheritdoc}
* Apply filter to collection and add not skipped attributes to select.
*
* @param \Magento\Eav\Model\Entity\Collection\AbstractCollection $collection
* @return \Magento\Eav\Model\Entity\Collection\AbstractCollection
* @since 100.2.0
*/
protected function _prepareEntityCollection(\Magento\Eav\Model\Entity\Collection\AbstractCollection $collection)
Expand Down Expand Up @@ -923,8 +932,7 @@ protected function getExportData()
}

/**
* Load products' data from the collection
* and filter it (if needed).
* Load products' data from the collection and filter it (if needed).
*
* @return array Keys are product IDs, values arrays with keys as store IDs
* and values as store-specific versions of Product entity.
Expand Down Expand Up @@ -1066,6 +1074,8 @@ private function wrapValue($value)
}

/**
* Collect multi raw data from
*
* @return array
*/
protected function collectMultirawData()
Expand Down Expand Up @@ -1107,6 +1117,8 @@ protected function collectMultirawData()
}

/**
* Check the current data has multiselect value
*
* @param \Magento\Catalog\Model\Product $item
* @param int $storeId
* @return bool
Expand All @@ -1119,6 +1131,8 @@ protected function hasMultiselectData($item, $storeId)
}

/**
* Collect multiselect values based on value
*
* @param \Magento\Catalog\Model\Product $item
* @param string $attrCode
* @param int $storeId
Expand All @@ -1143,6 +1157,8 @@ protected function collectMultiselectValues($item, $attrCode, $storeId)
}

/**
* Check attribute is valid
*
* @param string $code
* @param mixed $value
* @return bool
Expand All @@ -1162,6 +1178,8 @@ protected function isValidAttributeValue($code, $value)
}

/**
* Append multi row data
*
* @param array $dataRow
* @param array $multiRawData
* @return array
Expand Down Expand Up @@ -1291,6 +1309,8 @@ private function appendMultirowData(&$dataRow, $multiRawData)
}

/**
* Add multi row data to export
*
* @deprecated 100.1.0
* @param array $dataRow
* @param array $multiRawData
Expand Down Expand Up @@ -1338,6 +1358,8 @@ protected function _customHeadersMapping($rowData)
}

/**
* Convert option row to cell string
*
* @param array $option
* @return string
*/
Expand Down

0 comments on commit 5681284

Please sign in to comment.