Skip to content

Commit acdbd8e

Browse files
author
Bohdan Korablov
committed
Merge remote-tracking branch 'mainline/develop' into MAGETWO-56317-2
2 parents 99c7f0f + ebba5f8 commit acdbd8e

File tree

12 files changed

+260
-227
lines changed

12 files changed

+260
-227
lines changed

app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ class Suffix extends \Magento\Framework\App\Config\Value
4040
*/
4141
protected $resource;
4242

43+
/**
44+
* @var \Magento\Framework\App\Config\ScopePool
45+
*/
46+
private $scopePool;
47+
4348
/**
4449
* @param \Magento\Framework\Model\Context $context
4550
* @param \Magento\Framework\Registry $registry
@@ -75,6 +80,22 @@ public function __construct(
7580
$this->resource = $appResource;
7681
}
7782

83+
/**
84+
* Get instance of ScopePool
85+
*
86+
* @return \Magento\Framework\App\Config\ScopePool
87+
* @deprecated
88+
*/
89+
private function getScopePool()
90+
{
91+
if ($this->scopePool === null) {
92+
$this->scopePool = \Magento\Framework\App\ObjectManager::getInstance()->get(
93+
\Magento\Framework\App\Config\ScopePool::class
94+
);
95+
}
96+
return $this->scopePool;
97+
}
98+
7899
/**
79100
* Check url rewrite suffix - whether we can support it
80101
*
@@ -103,6 +124,24 @@ public function afterSave()
103124
return parent::afterSave();
104125
}
105126

127+
/**
128+
* {@inheritdoc}
129+
*/
130+
public function afterDeleteCommit()
131+
{
132+
if ($this->isValueChanged()) {
133+
$this->updateSuffixForUrlRewrites();
134+
if ($this->isCategorySuffixChanged()) {
135+
$this->cacheTypeList->invalidate([
136+
\Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER,
137+
\Magento\Framework\App\Cache\Type\Collection::TYPE_IDENTIFIER
138+
]);
139+
}
140+
}
141+
142+
return parent::afterDeleteCommit();
143+
}
144+
106145
/**
107146
* Check is category suffix changed
108147
*
@@ -135,7 +174,12 @@ protected function updateSuffixForUrlRewrites()
135174
}
136175
$entities = $this->urlFinder->findAllByData($dataFilter);
137176
$oldSuffixPattern = '~' . preg_quote($this->getOldValue()) . '$~';
138-
$suffix = $this->getValue();
177+
if ($this->getValue() !== null) {
178+
$suffix = $this->getValue();
179+
} else {
180+
$this->getScopePool()->clean();
181+
$suffix = $this->_config->getValue($this->getPath());
182+
}
139183
foreach ($entities as $urlRewrite) {
140184
$bind = $urlRewrite->getIsAutogenerated()
141185
? [UrlRewrite::REQUEST_PATH => preg_replace($oldSuffixPattern, $suffix, $urlRewrite->getRequestPath())]

app/code/Magento/Checkout/view/frontend/web/js/view/shipping.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ define(
179179
newShippingAddress;
180180

181181
this.source.set('params.invalid', false);
182-
this.source.trigger('shippingAddress.data.validate');
182+
this.triggerShippingDataValidateEvent();
183183

184184
if (!this.source.get('params.invalid')) {
185185
addressData = this.source.get('shippingAddress');
@@ -254,12 +254,7 @@ define(
254254

255255
if (this.isFormInline) {
256256
this.source.set('params.invalid', false);
257-
this.source.trigger('shippingAddress.data.validate');
258-
259-
if (this.source.get('shippingAddress.custom_attributes')) {
260-
this.source.trigger('shippingAddress.custom_attributes.data.validate');
261-
}
262-
257+
this.triggerShippingDataValidateEvent();
263258
if (emailValidationResult &&
264259
this.source.get('params.invalid') ||
265260
!quote.shippingMethod().method_code ||
@@ -304,6 +299,18 @@ define(
304299
}
305300

306301
return true;
302+
},
303+
304+
/**
305+
* Trigger Shipping data Validate Event.
306+
*
307+
* @return {void}
308+
*/
309+
triggerShippingDataValidateEvent: function () {
310+
this.source.trigger('shippingAddress.data.validate');
311+
if (this.source.get('shippingAddress.custom_attributes')) {
312+
this.source.trigger('shippingAddress.custom_attributes.data.validate');
313+
}
307314
}
308315
});
309316
}

app/code/Magento/ConfigurableProduct/Block/Plugin/Product/Media/Gallery.php

Lines changed: 0 additions & 102 deletions
This file was deleted.

app/code/Magento/ConfigurableProduct/Test/Unit/Block/Plugin/Product/Media/GalleryTest.php

Lines changed: 0 additions & 111 deletions
This file was deleted.

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@
143143
<type name="Magento\Catalog\Model\Product\Attribute\Backend\Price">
144144
<plugin name="configurable" type="Magento\ConfigurableProduct\Model\Plugin\PriceBackend" sortOrder="100" />
145145
</type>
146-
<type name="\Magento\ProductVideo\Block\Product\View\Gallery">
147-
<plugin name="product_video_gallery" type="\Magento\ConfigurableProduct\Block\Plugin\Product\Media\Gallery" />
148-
</type>
149146
<type name="Magento\ConfigurableProduct\Model\Product\Type\Configurable">
150147
<arguments>
151148
<argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Collection</argument>

app/code/Magento/Wishlist/view/frontend/layout/catalog_product_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</arguments>
1717
</block>
1818
<referenceBlock name="product.info.addto">
19-
<block class="Magento\Wishlist\Block\Catalog\Product\View\AddTo\Wishlist" name="view.addto.wishlist" after="view.addto.requisition"
19+
<block class="Magento\Wishlist\Block\Catalog\Product\View\AddTo\Wishlist" name="view.addto.wishlist"
2020
template="Magento_Wishlist::catalog/product/view/addto/wishlist.phtml" />
2121
</referenceBlock>
2222
</referenceContainer>

app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<update handle="catalog_product_view"/>
1010
<body>
1111
<referenceBlock name="product.info.addto">
12-
<block class="Magento\Wishlist\Block\Item\Configure" name="view.addto.wishlist" after="view.addto.requisition"
12+
<block class="Magento\Wishlist\Block\Item\Configure" name="view.addto.wishlist"
1313
template="item/configure/addto/wishlist.phtml" />
1414
</referenceBlock>
1515
</body>

app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<block class="Magento\Catalog\Block\Product\View" name="product.info.addtocart.bundle" as="addtocart" template="product/view/addtocart.phtml" />
2121
<block class="Magento\Catalog\Block\Product\View" name="product.info.addto.bundle" as="addto" after="product.info.addtocart.bundle"
2222
template="Magento_Catalog::product/view/addto.phtml" cacheable="false">
23-
<block class="Magento\Wishlist\Block\Item\Configure" name="view.addto.wishlist.bundle" after="view.addto.requisition"
23+
<block class="Magento\Wishlist\Block\Item\Configure" name="view.addto.wishlist.bundle"
2424
template="item/configure/addto/wishlist.phtml" />
2525
<block class="Magento\Catalog\Block\Product\View\AddTo\Compare" name="view.addto.compare.bundle" after="view.addto.wishlist"
2626
template="Magento_Catalog::product/view/addto/compare.phtml" />

0 commit comments

Comments
 (0)