Closed
Description
Preconditions and environment
- Magento 2.4.4 version
- PHP versions: 7.4 / 8.1
- Configurations:
-
- Configurations -> Catalog [Catalog tab] -> Search Engine Optimization -> Generate "category/product" URL Rewrites = Yes
Steps to reproduce
- Install new magento.
- Create a new store view and assign it to a current Store (There should be 2 store views)
- Create 2 new categories under root category.
- Create a new product and assign a single category to a product.
- Edit a product under a first store scope and unselect "Use Default Value" for a "Url key" field in "Search Engine Optimization" tab.
- Edit a product under "All store views" scope and assign the 2nd category.
Expected result
All product/category association url rewrites should be generated for the first store view.
Actual result
There is no url rewrite generated for a 2nd assigned category in the first store view.
Additional information
The url rewrite is not generated for newly assigned categories if "Use default value" checkbox is unmarked in a specific store view.
It seems the following code skips url generation for these conditions:
`
public function generateForGlobalScope($productCategories, Product $product, $rootCategoryId = null)
{
$productId = $product->getEntityId();
$mergeDataProvider = clone $this->mergeDataProviderPrototype;
foreach ($product->getStoreIds() as $id) {
if (!$this->isGlobalScope($id) &&
!$this->storeViewService->doesEntityHaveOverriddenUrlKeyForStore(
$id,
$productId,
Product::ENTITY
)) {
$mergeDataProvider->merge(
$this->generateForSpecificStoreView($id, $productCategories, $product, $rootCategoryId)
);
}
}
return $mergeDataProvider->getData();
}
`
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.