Skip to content

Commit 450bec0

Browse files
committed
MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories
1 parent e3c474d commit 450bec0

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteGeneratorTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ public function testGenerateUrlRewritesWithoutSaveHistory()
8686
'catalog/product/view/id/' . $productForTest . '/category/4',
8787
1,
8888
0
89+
],
90+
[
91+
'/simple-product-two.html',
92+
'catalog/product/view/id/' . $productForTest . '/category/2',
93+
1,
94+
0
8995
]
9096
];
9197

@@ -168,6 +174,12 @@ public function testGenerateUrlRewritesWithSaveHistory()
168174
1,
169175
0
170176
],
177+
[
178+
'/simple-product-two.html',
179+
'catalog/product/view/id/' . $productForTest . '/category/2',
180+
1,
181+
0
182+
],
171183
[
172184
'category-1/simple-product-two.html',
173185
'new-url/simple-product-two.html',

dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/categories_with_products.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
4343
->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
4444
->save();
45-
$categoryLinkManagement->assignProductToCategories($product->getSku(), [3, 4]);
45+
$categoryLinkManagement->assignProductToCategories($product->getSku(), [2, 3, 4]);
4646

4747
$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class);
4848
$product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE)

0 commit comments

Comments
 (0)