Skip to content

Commit 54888cf

Browse files
author
Momotenko,Natalia(nmomotenko)
committed
Merge pull request #566 from magento-sparta/2-0-5-backlog-1
[SUPPORT] MDVA-198: 2.0.5 backlog
2 parents b6bb8e5 + 25428fd commit 54888cf

File tree

35 files changed

+379
-114
lines changed

35 files changed

+379
-114
lines changed

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -531,15 +531,21 @@ protected function processCountExistingPrices($prices, $table)
531531
{
532532
$existingPrices = $this->_connection->fetchAssoc(
533533
$this->_connection->select()->from(
534-
$this->_connection->getTableName($table),
534+
['t' => $this->_connection->getTableName($table)],
535535
['value_id', 'entity_id', 'all_groups', 'customer_group_id']
536536
)
537+
->joinInner(
538+
['e' => $this->_connection->getTableName('catalog_product_entity')],
539+
't.entity_id = e.entity_id',
540+
['e.sku']
541+
)
542+
->where(
543+
$this->_connection->quoteInto('e.sku IN (?)', array_keys($prices))
544+
)
537545
);
538546
foreach ($existingPrices as $existingPrice) {
539-
foreach ($this->_oldSkus as $sku => $productId) {
540-
if ($existingPrice['entity_id'] == $productId && isset($prices[$sku])) {
541-
$this->incrementCounterUpdated($prices[$sku], $existingPrice);
542-
}
547+
if (isset($prices[$existingPrice['sku']])) {
548+
$this->incrementCounterUpdated($prices[$existingPrice['sku']], $existingPrice);
543549
}
544550
}
545551

app/code/Magento/Backend/Helper/Dashboard/Order.php

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Backend\Helper\Dashboard;
77

8+
use Magento\Framework\App\ObjectManager;
9+
810
/**
911
* Adminhtml dashboard helper for orders
1012
*/
@@ -15,6 +17,11 @@ class Order extends \Magento\Backend\Helper\Dashboard\AbstractDashboard
1517
*/
1618
protected $_orderCollection;
1719

20+
/**
21+
* @var \Magento\Store\Model\StoreManagerInterface
22+
*/
23+
protected $_storeManager;
24+
1825
/**
1926
* @param \Magento\Framework\App\Helper\Context $context
2027
* @param \Magento\Reports\Model\ResourceModel\Order\Collection $orderCollection
@@ -41,17 +48,31 @@ protected function _initCollection()
4148
if ($this->getParam('store')) {
4249
$this->_collection->addFieldToFilter('store_id', $this->getParam('store'));
4350
} elseif ($this->getParam('website')) {
44-
$storeIds = $this->_storeManager->getWebsite($this->getParam('website'))->getStoreIds();
51+
$storeIds = $this->getStoreManager()->getWebsite($this->getParam('website'))->getStoreIds();
4552
$this->_collection->addFieldToFilter('store_id', ['in' => implode(',', $storeIds)]);
4653
} elseif ($this->getParam('group')) {
47-
$storeIds = $this->_storeManager->getGroup($this->getParam('group'))->getStoreIds();
54+
$storeIds = $this->getStoreManager()->getGroup($this->getParam('group'))->getStoreIds();
4855
$this->_collection->addFieldToFilter('store_id', ['in' => implode(',', $storeIds)]);
4956
} elseif (!$this->_collection->isLive()) {
5057
$this->_collection->addFieldToFilter(
5158
'store_id',
52-
['eq' => $this->_storeManager->getStore(\Magento\Store\Model\Store::ADMIN_CODE)->getId()]
59+
['eq' => $this->getStoreManager()->getStore(\Magento\Store\Model\Store::ADMIN_CODE)->getId()]
5360
);
5461
}
5562
$this->_collection->load();
5663
}
64+
65+
/**
66+
* Get Store Manager
67+
*
68+
* @return \Magento\Store\Model\StoreManagerInterface
69+
*/
70+
public function getStoreManager()
71+
{
72+
if (!$this->_storeManager) {
73+
$this->_storeManager = ObjectManager::getInstance()->get('Magento\Store\Model\StoreManager');
74+
}
75+
76+
return $this->_storeManager;
77+
}
5778
}

app/code/Magento/Captcha/view/adminhtml/layout/adminhtml_auth_forgotpassword.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<body>
1010
<referenceContainer name="form.additional.info">
11-
<block class="Magento\Captcha\Block\Captcha" name="captcha">
11+
<block class="Magento\Captcha\Block\Captcha" name="captcha" cacheable="false">
1212
<action method="setFormId">
1313
<argument name="formId" xsi:type="string">backend_forgotpassword</argument>
1414
</action>

app/code/Magento/Captcha/view/adminhtml/layout/adminhtml_auth_login.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<body>
1010
<referenceContainer name="form.additional.info">
11-
<block class="Magento\Captcha\Block\Captcha" name="captcha">
11+
<block class="Magento\Captcha\Block\Captcha" name="captcha" cacheable="false">
1212
<action method="setFormId">
1313
<argument name="formId" xsi:type="string">backend_login</argument>
1414
</action>

app/code/Magento/Captcha/view/frontend/layout/contact_index_index.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<body>
1010
<referenceContainer name="form.additional.info">
11-
<block class="Magento\Captcha\Block\Captcha" name="captcha" after="-">
11+
<block class="Magento\Captcha\Block\Captcha" name="captcha" after="-" cacheable="false">
1212
<action method="setFormId">
1313
<argument name="formId" xsi:type="string">contact_us</argument>
1414
</action>

app/code/Magento/Captcha/view/frontend/layout/customer_account_create.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<body>
1010
<referenceContainer name="form.additional.info">
11-
<block class="Magento\Captcha\Block\Captcha" name="captcha" after="-">
11+
<block class="Magento\Captcha\Block\Captcha" name="captcha" after="-" cacheable="false">
1212
<action method="setFormId">
1313
<argument name="formId" xsi:type="string">user_create</argument>
1414
</action>

app/code/Magento/Captcha/view/frontend/layout/customer_account_forgotpassword.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<body>
1010
<referenceContainer name="form.additional.info">
11-
<block class="Magento\Captcha\Block\Captcha" name="captcha" after="-">
11+
<block class="Magento\Captcha\Block\Captcha" name="captcha" after="-" cacheable="false">
1212
<action method="setFormId">
1313
<argument name="formId" xsi:type="string">user_forgotpassword</argument>
1414
</action>

app/code/Magento/Captcha/view/frontend/layout/customer_account_login.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<body>
1010
<referenceContainer name="form.additional.info">
11-
<block class="Magento\Captcha\Block\Captcha" name="captcha" after="-">
11+
<block class="Magento\Captcha\Block\Captcha" name="captcha" after="-" cacheable="false">
1212
<action method="setFormId">
1313
<argument name="formId" xsi:type="string">user_login</argument>
1414
</action>

app/code/Magento/Catalog/Controller/Category/View.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,15 @@ public function execute()
172172
if ($settings->getPageLayout()) {
173173
$page->getConfig()->setPageLayout($settings->getPageLayout());
174174
}
175+
176+
$hasChildren = $category->hasChildren();
175177
if ($category->getIsAnchor()) {
176-
$type = $category->hasChildren() ? 'layered' : 'layered_without_children';
178+
$type = $hasChildren ? 'layered' : 'layered_without_children';
177179
} else {
178-
$type = $category->hasChildren() ? 'default' : 'default_without_children';
180+
$type = $hasChildren ? 'default' : 'default_without_children';
179181
}
180182

181-
if (!$category->hasChildren()) {
183+
if (!$hasChildren) {
182184
// Two levels removed from parent. Need to add default page type.
183185
$parentType = strtok($type, '_');
184186
$page->addPageLayoutHandles(['type' => $parentType]);

app/code/Magento/Catalog/Model/Layer/Filter/DataProvider/Category.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,18 @@ public function getCategory()
112112
/** @var CategoryModel|null $category */
113113
$category = null;
114114
if ($this->categoryId !== null) {
115-
$category = $this->categoryFactory->create()
116-
->setStoreId(
117-
$this->getLayer()
118-
->getCurrentStore()
119-
->getId()
120-
)
121-
->load($this->categoryId);
115+
$currentCategory = $this->coreRegistry->registry('current_category');
116+
if ($currentCategory !== null && $currentCategory->getId() == $this->categoryId) {
117+
$category = $currentCategory;
118+
} else {
119+
$category = $this->categoryFactory->create()
120+
->setStoreId(
121+
$this->getLayer()
122+
->getCurrentStore()
123+
->getId()
124+
)
125+
->load($this->categoryId);
126+
}
122127
}
123128

124129
if ($category === null || !$category->getId()) {

0 commit comments

Comments
 (0)