Skip to content

Commit 855eaf0

Browse files
andimovslopukhov
authored andcommitted
MC-4244: Skip URL rewrites multiplication
-- change option name
1 parent d644c11 commit 855eaf0

23 files changed

+65
-69
lines changed

app/code/Magento/CatalogUrlRewrite/Model/ProductScopeRewriteGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,12 @@ private function getCategoryWithOverriddenUrlKey($storeId, Category $category)
259259
}
260260

261261
/**
262-
* Check config value of generate_rewrites_on_save
262+
* Check config value of generate_category_product_rewrites
263263
*
264264
* @return bool
265265
*/
266266
private function isCategoryRewritesEnabled()
267267
{
268-
return (bool)$this->config->getValue('catalog/seo/generate_rewrites_on_save');
268+
return (bool)$this->config->getValue('catalog/seo/generate_category_product_rewrites');
269269
}
270270
}

app/code/Magento/CatalogUrlRewrite/Model/TableCleaner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use Magento\UrlRewrite\Model\ResourceModel\UrlRewrite;
1919

2020
/**
21-
* Table Cleaner in case of switching generate_rewrites_on_save off
21+
* Table Cleaner in case of switching generate_category_product_rewrites off
2222
*/
2323
class TableCleaner extends ConfigValue
2424
{

app/code/Magento/CatalogUrlRewrite/Observer/AfterImportDataObserver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,12 +605,12 @@ private function getCategoryById($categoryId, $storeId)
605605
}
606606

607607
/**
608-
* Check config value of generate_rewrites_on_save
608+
* Check config value of generate_category_product_rewrites
609609
*
610610
* @return bool
611611
*/
612612
private function isCategoryRewritesEnabled()
613613
{
614-
return (bool)$this->scopeConfig->getValue('catalog/seo/generate_rewrites_on_save');
614+
return (bool)$this->scopeConfig->getValue('catalog/seo/generate_category_product_rewrites');
615615
}
616616
}

app/code/Magento/CatalogUrlRewrite/Observer/CategoryProcessUrlRewriteMovingObserver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ private function resetUrlRewritesDataMaps($category)
132132
}
133133

134134
/**
135-
* Check config value of generate_rewrites_on_save
135+
* Check config value of generate_category_product_rewrites
136136
*
137137
* @return bool
138138
*/
139139
private function isCategoryRewritesEnabled()
140140
{
141-
return (bool)$this->scopeConfig->getValue('catalog/seo/generate_rewrites_on_save');
141+
return (bool)$this->scopeConfig->getValue('catalog/seo/generate_category_product_rewrites');
142142
}
143143
}

app/code/Magento/CatalogUrlRewrite/Observer/CategoryProcessUrlRewriteSavingObserver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,12 @@ private function resetUrlRewritesDataMaps($category)
203203
}
204204

205205
/**
206-
* Check config value of generate_rewrites_on_save
206+
* Check config value of generate_category_product_rewrites
207207
*
208208
* @return bool
209209
*/
210210
private function isCategoryRewritesEnabled()
211211
{
212-
return (bool)$this->scopeConfig->getValue('catalog/seo/generate_rewrites_on_save');
212+
return (bool)$this->scopeConfig->getValue('catalog/seo/generate_category_product_rewrites');
213213
}
214214
}

app/code/Magento/CatalogUrlRewrite/Observer/UrlRewriteHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ private function getCategoryProductsUrlRewrites(
235235
$rootCategoryId = null
236236
) {
237237
$mergeDataProvider = clone $this->mergeDataProviderPrototype;
238-
$generateProductRewrite = (bool)$this->scopeConfig->getValue('catalog/seo/generate_rewrites_on_save');
238+
$generateProductRewrite = (bool)$this->scopeConfig->getValue('catalog/seo/generate_category_product_rewrites');
239239

240240
/** @var Collection $productCollection */
241241
$productCollection = $this->productCollectionFactory->create();

app/code/Magento/CatalogUrlRewrite/Plugin/DynamicCategoryRewrites.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ public function __construct(
5050
}
5151

5252
/**
53-
* Check config value of generate_rewrites_on_save
53+
* Check config value of generate_category_product_rewrites
5454
*
5555
* @return bool
5656
*/
5757
private function isCategoryRewritesEnabled()
5858
{
59-
return (bool)$this->config->getValue('catalog/seo/generate_rewrites_on_save');
59+
return (bool)$this->config->getValue('catalog/seo/generate_category_product_rewrites');
6060
}
6161

6262
/**

app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/ProductScopeRewriteGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function ($value) {
121121
public function testGenerationForGlobalScope()
122122
{
123123
$this->configMock->expects($this->any())->method('getValue')
124-
->with('catalog/seo/generate_rewrites_on_save')
124+
->with('catalog/seo/generate_category_product_rewrites')
125125
->willReturn('1');
126126
$product = $this->createMock(\Magento\Catalog\Model\Product::class);
127127
$product->expects($this->any())->method('getStoreId')->will($this->returnValue(null));

app/code/Magento/CatalogUrlRewrite/etc/adminhtml/system.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
<label>Create Permanent Redirect for URLs if URL Key Changed</label>
2929
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
3030
</field>
31-
<field id="generate_rewrites_on_save" translate="label" type="select" sortOrder="6" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
32-
<label>Generate URL Rewrites for Products in Categories</label>
31+
<field id="generate_category_product_rewrites" translate="label" type="select" sortOrder="6" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
32+
<label>Generate "category/product" URL Rewrites</label>
3333
<backend_model>Magento\CatalogUrlRewrite\Model\TableCleaner</backend_model>
3434
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
3535
<comment>
3636
<![CDATA[<strong style="color:red">Warning!</strong> Turning this option off will result in permanent removal of category/product URL rewrites without an ability to restore them.]]>
3737
</comment>
38-
<frontend_class>generate_rewrites_on_save</frontend_class>
38+
<frontend_class>generate_category_product_rewrites</frontend_class>
3939
</field>
4040
</group>
4141
</section>

app/code/Magento/CatalogUrlRewrite/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<default>
1010
<catalog>
1111
<seo>
12-
<generate_rewrites_on_save>1</generate_rewrites_on_save>
12+
<generate_category_product_rewrites>1</generate_category_product_rewrites>
1313
</seo>
1414
</catalog>
1515
</default>

0 commit comments

Comments
 (0)