Skip to content

Commit 4236389

Browse files
committed
Merge branch '2.3-develop' of github.com:magento/magento2ce into MAGETWO-89736
2 parents 294e5cf + d83f3f5 commit 4236389

File tree

13 files changed

+60
-31
lines changed

13 files changed

+60
-31
lines changed

app/code/Magento/Catalog/Model/Product/Price/TierPriceStorage.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,10 @@ private function getExistingPrices(array $skus, $groupBySku = false)
172172
$rawPrices = $this->tierPricePersistence->get($ids);
173173
$prices = [];
174174

175+
$linkField = $this->tierPricePersistence->getEntityLinkField();
176+
$skuByIdLookup = $this->buildSkuByIdLookup($skus);
175177
foreach ($rawPrices as $rawPrice) {
176-
$sku = $this->retrieveSkuById($rawPrice[$this->tierPricePersistence->getEntityLinkField()], $skus);
178+
$sku = $skuByIdLookup[$rawPrice[$linkField]];
177179
$price = $this->tierPriceFactory->create($rawPrice, $sku);
178180
if ($groupBySku) {
179181
$prices[$sku][] = $price;
@@ -300,21 +302,21 @@ private function isCorrectPriceValue(array $existingPrice, array $price)
300302
}
301303

302304
/**
303-
* Retrieve SKU by product ID.
305+
* Generate lookup to retrieve SKU by product ID.
304306
*
305-
* @param int $id
306307
* @param array $skus
307-
* @return string|null
308+
* @return array
308309
*/
309-
private function retrieveSkuById($id, $skus)
310+
private function buildSkuByIdLookup($skus)
310311
{
312+
$lookup = [];
311313
foreach ($this->productIdLocator->retrieveProductIdsBySkus($skus) as $sku => $ids) {
312-
if (isset($ids[$id])) {
313-
return $sku;
314+
foreach (array_keys($ids) as $id) {
315+
$lookup[$id] = $sku;
314316
}
315317
}
316318

317-
return null;
319+
return $lookup;
318320
}
319321

320322
/**

app/code/Magento/Catalog/Model/ResourceModel/Eav/Attribute.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -895,18 +895,4 @@ public function setIsFilterableInGrid($isFilterableInGrid)
895895
$this->setData(self::IS_FILTERABLE_IN_GRID, $isFilterableInGrid);
896896
return $this;
897897
}
898-
899-
/**
900-
* @return \Magento\Eav\Api\Data\AttributeExtensionInterface
901-
*/
902-
public function getExtensionAttributes()
903-
{
904-
$extensionAttributes = $this->_getExtensionAttributes();
905-
if (null === $extensionAttributes) {
906-
/** @var \Magento\Eav\Api\Data\AttributeExtensionInterface $extensionAttributes */
907-
$extensionAttributes = $this->eavAttributeFactory->create();
908-
$this->setExtensionAttributes($extensionAttributes);
909-
}
910-
return $extensionAttributes;
911-
}
912898
}

app/code/Magento/Catalog/Plugin/Block/Topmenu.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ private function getCategoryAsArray($category, $currentCategory, $isParentActive
162162
'url' => $this->catalogCategory->getCategoryUrl($category),
163163
'has_active' => in_array((string)$category->getId(), explode('/', $currentCategory->getPath()), true),
164164
'is_active' => $category->getId() == $currentCategory->getId(),
165+
'is_category' => true,
165166
'is_parent_active' => $isParentActive
166167
];
167168
}

app/code/Magento/Catalog/view/frontend/web/js/product/breadcrumbs.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ define([
1616
categoryUrlSuffix: '',
1717
useCategoryPathInUrl: false,
1818
product: '',
19+
categoryItemSelector: '.category-item',
1920
menuContainer: '[data-action="navigation"] > ul'
2021
},
2122

@@ -163,7 +164,10 @@ define([
163164
categoryMenuItem = null;
164165

165166
if (categoryUrl && menu.length) {
166-
categoryMenuItem = menu.find('a[href="' + categoryUrl + '"]');
167+
categoryMenuItem = menu.find(
168+
this.options.categoryItemSelector +
169+
' > a[href="' + categoryUrl + '"]'
170+
);
167171
}
168172

169173
return categoryMenuItem;

app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ abstract class AbstractAttribute extends \Magento\Framework\Model\AbstractExtens
141141
'static',
142142
];
143143

144+
/**
145+
* @var \Magento\Eav\Api\Data\AttributeExtensionFactory
146+
*/
147+
private $eavExtensionFactory;
148+
144149
/**
145150
* @param \Magento\Framework\Model\Context $context
146151
* @param \Magento\Framework\Registry $registry
@@ -157,6 +162,7 @@ abstract class AbstractAttribute extends \Magento\Framework\Model\AbstractExtens
157162
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
158163
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
159164
* @param array $data
165+
* @param \Magento\Eav\Api\Data\AttributeExtensionFactory|null $eavExtensionFactory
160166
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
161167
* @codeCoverageIgnore
162168
*/
@@ -175,7 +181,8 @@ public function __construct(
175181
\Magento\Framework\Api\DataObjectHelper $dataObjectHelper,
176182
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
177183
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
178-
array $data = []
184+
array $data = [],
185+
\Magento\Eav\Api\Data\AttributeExtensionFactory $eavExtensionFactory = null
179186
) {
180187
parent::__construct(
181188
$context,
@@ -194,6 +201,8 @@ public function __construct(
194201
$this->optionDataFactory = $optionDataFactory;
195202
$this->dataObjectProcessor = $dataObjectProcessor;
196203
$this->dataObjectHelper = $dataObjectHelper;
204+
$this->eavExtensionFactory = $eavExtensionFactory ?: \Magento\Framework\App\ObjectManager::getInstance()
205+
->get(\Magento\Eav\Api\Data\AttributeExtensionFactory::class);
197206
}
198207

199208
/**
@@ -1314,7 +1323,13 @@ public function setValidationRules(array $validationRules = null)
13141323
*/
13151324
public function getExtensionAttributes()
13161325
{
1317-
return $this->_getExtensionAttributes();
1326+
$extensionAttributes = $this->_getExtensionAttributes();
1327+
if (!($extensionAttributes instanceof \Magento\Eav\Api\Data\AttributeExtensionInterface)) {
1328+
/** @var \Magento\Eav\Api\Data\AttributeExtensionInterface $extensionAttributes */
1329+
$extensionAttributes = $this->eavExtensionFactory->create();
1330+
$this->setExtensionAttributes($extensionAttributes);
1331+
}
1332+
return $extensionAttributes;
13181333
}
13191334

13201335
/**

app/code/Magento/Multishipping/Block/Checkout/AbstractMultishipping.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
/**
8-
* Mustishipping checkout base abstract block
8+
* Multishipping checkout base abstract block
99
*
1010
* @author Magento Core Team <core@magentocommerce.com>
1111
*/

app/code/Magento/Multishipping/Block/Checkout/Shipping.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Magento\Quote\Model\Quote\Address;
1010

1111
/**
12-
* Mustishipping checkout shipping
12+
* Multishipping checkout shipping
1313
*
1414
* @api
1515
* @author Magento Core Team <core@magentocommerce.com>

app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Discount.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
*/
1616
class Discount extends \Magento\Sales\Block\Adminhtml\Order\Create\Totals\DefaultTotals
1717
{
18-
//protected $_template = 'tax/checkout/subtotal.phtml';
19-
20-
//protected $_template = 'tax/checkout/subtotal.phtml';
18+
/**
19+
* @var \Magento\Tax\Model\Config
20+
*/
2121
protected $_taxConfig;
2222

2323
/**

app/code/Magento/Theme/Block/Html/Topmenu.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ protected function _getMenuItemClasses(\Magento\Framework\Data\Tree\Node $item)
309309
$classes[] = 'level' . $item->getLevel();
310310
$classes[] = $item->getPositionClass();
311311

312+
if ($item->getIsCategory()) {
313+
$classes[] = 'category-item';
314+
}
315+
312316
if ($item->getIsFirst()) {
313317
$classes[] = 'first';
314318
}

app/code/Magento/Ui/etc/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@
252252
<type name="Magento\Framework\Data\Argument\Interpreter\Composite">
253253
<arguments>
254254
<argument name="interpreters" xsi:type="array">
255+
<item name="const" xsi:type="object">Magento\Framework\Data\Argument\Interpreter\Constant</item>
255256
<item name="object" xsi:type="object">configurableObjectArgumentInterpreterProxy</item>
256257
<item name="configurableObject" xsi:type="object">configurableObjectArgumentInterpreterProxy</item>
257258
<item name="array" xsi:type="object">arrayArgumentInterpreterProxy</item>

0 commit comments

Comments
 (0)