-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #524 from magento-dragons/mx-virtual-pr
[MX Virtual Team] Github bugs
- Loading branch information
Showing
4 changed files
with
9 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -928,13 +928,14 @@ protected function collectMultirawData() | |
array_keys($this->_websiteIdToCode), | ||
$item->getWebsites() | ||
); | ||
$rowCategories[$item->getId()] = $item->getCategoryIds(); | ||
$rowCategories[$item->getId()] = array_combine($item->getCategoryIds(), $item->getCategoryIds()); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Vinai
Contributor
|
||
} | ||
$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; | ||
|
@@ -1218,14 +1219,16 @@ 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)) { | ||
$collection->removeItemByKey($attribute->getId()); | ||
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) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What a weird hat-trick. Not sure yet why one would prefer to manipulate a hash instead of an array here.