Closed
Description
Preconditions (*)
- Magento 2.4.1, 2.4.3 (this problem may exist from 2.3.3).
Stores -> Configuration -> Catalog -> Catalog -> Search Engine Optimization -> Product URL Suffix
is empty.Stores -> Configuration -> Catalog -> Catalog -> Search Engine Optimization -> Category URL Suffix
is empty.Stores -> Configuration -> Catalog -> Catalog -> Search Engine Optimization -> Use Categories Path For Product URLs
is Yes.Stores -> Configuration -> Catalog -> Catalog -> Search Engine Optimization -> Generate "category/product" URL Rewrites
is No.- There is a category
Test Category
created under root category andTest Sub Category
created underTest Category
. There is a productTest
and it is assigned toTest Sub Category
. This is to make category url path have the product url path in it preceded by a forward slash (/). In this example the product url path is "test" andTest Sub Category
url path is "test-category/test-sub-category"
Steps to reproduce (*)
- Go to
Test Sub Category
. - Click on product
Test
.
Expected result (*)
- The product page is loaded successfully.
Actual result (*)
- There is 404 error (on 2.4.3 or newer version) or 500 error (on older version than 2.4.3).
Looks like on line 173 in \Magento\CatalogUrlRewrite\Model\Storage\DynamicStorage
function str_replace
should not be used. We fixed it on our installation by changing that line to this:
$categoryPath = substr($requestPath, 0, -1 * strlen('/' . $productUrl));
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- 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”.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Ready for Development