Skip to content

Commit

Permalink
Merge pull request #524 from magento-dragons/mx-virtual-pr
Browse files Browse the repository at this point in the history
[MX  Virtual Team] Github bugs
  • Loading branch information
Kasian,Andrii(akasian) committed Aug 14, 2015
2 parents 6f68ff9 + 007aeb2 commit 1d40050
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ define([
var $checkbox = $(event.currentTarget);
var $imageContainer = $checkbox.closest('[data-role=dialog]').data('imageContainer');
$imageContainer.toggleClass('hidden-for-front', $checkbox.is(':checked'));
$imageContainer.find('[name*="disabled"]').val($checkbox.is(':checked') ? 1 : 0);
},

/**
Expand Down
9 changes: 6 additions & 3 deletions app/code/Magento/CatalogImportExport/Model/Export/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Copy link
@dav-m85

dav-m85 Aug 17, 2015

What a weird hat-trick. Not sure yet why one would prefer to manipulate a hash instead of an array here.

This comment has been minimized.

Copy link
@Vinai

Vinai Aug 17, 2015

Contributor

Checking for hash keys is a lot quicker, see further down in this patch.

This comment has been minimized.

Copy link
@dav-m85
}
$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;
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 1 addition & 3 deletions app/code/Magento/Customer/Model/Customer/DataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ public function getData()
$addresses[$addressId] = $address->getData();
$this->prepareAddressData($addressId, $addresses, $result['customer']);
}
if (!empty($addresses)) {
$result['address'] = $addresses;
}
$result['address'] = $addresses;

$this->loadedData[$customer->getId()] = $result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* Template for filter items block
*
* @var $block \Magento\LayeredNavigation\Block\Layer\Filter\Renderer
* @var $block \Magento\LayeredNavigation\Block\Navigation\FilterRenderer
*/
?>

Expand Down

0 comments on commit 1d40050

Please sign in to comment.