Skip to content

Commit cf2e981

Browse files
committed
MC-4244: Skip URL rewrites multiplication
1 parent cbdc91d commit cf2e981

File tree

4 files changed

+46
-24
lines changed

4 files changed

+46
-24
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
9+
<body>
10+
<referenceContainer name="js">
11+
<block name="js.confirm_remove_old_urls" template="Magento_CatalogUrlRewrite::confirm.phtml"/>
12+
</referenceContainer>
13+
</body>
14+
</page>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
?>
8+
<script>
9+
require([
10+
"jquery",
11+
"Magento_Ui/js/modal/confirm",
12+
"mage/translate",
13+
], function(jQuery, confirmation, $t) {
14+
//confirmation for removing category/product URL rewrites
15+
jQuery('select.generate_category_product_rewrites').on('change', function () {
16+
if (this.value == 0) {
17+
confirmation({
18+
title: $t('Turn off "category/products" URL rewrites?'),
19+
content: $t('Turning off automatic generation of "category/products" URL rewrites will result in permanent removal of all the currently existing “category/product” type URL rewrites without an ability to restore them back. ' +
20+
'This may potentially cause unresolved “category/product” type URL conflicts which you have to resolve by updating URL key manually.'),
21+
actions: {
22+
cancel: function () {
23+
jQuery('select.generate_category_product_rewrites').val(1);
24+
return false;
25+
},
26+
}
27+
})
28+
}
29+
});
30+
});
31+
</script>

app/code/Magento/CatalogUrlRewrite/view/adminhtml/web/js/config/confirm.js

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

app/code/Magento/Config/view/adminhtml/templates/system/config/edit.phtml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ require([
3838
"prototype",
3939
"mage/adminhtml/form",
4040
"domReady!",
41-
"jquery/ui",
42-
"Magento_CatalogUrlRewrite/js/config/confirm"
41+
"jquery/ui"
4342
], function(jQuery, registry){
4443

4544
var adminSystemConfig = {

0 commit comments

Comments
 (0)