-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix use_default
not removing store-specific value of url_key
and url_path
for Categories
#27291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix use_default
not removing store-specific value of url_key
and url_path
for Categories
#27291
Conversation
1. Added Integration test that covers change 2. Moved Observer functionality to beforeSave plugin
Hi @lbajsarowicz. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
use_default
not removing store-specific valueuse_default
not removing store-specific value of url_key
and url_path
for Categories
According to Integration Tests there are still 2 steps to be done:
|
I'm reducing the scope of the PR once again. |
023b473
to
3d3e19c
Compare
use_default
not removing store-specific value of url_key
and url_path
for Categoriesuse_default
not removing store-specific value of url_key
and url_path
for Categories
I'm really sorry to disappoint you, as due to limited time, I was unable to accomplish that bugfix before 2.4 feature freeze. I'm going to fix this before 2.5 |
Hi @lbajsarowicz, thank you for your contribution! |
Description (*)
This PR is my 2nd approach to the issues with Categories and support of Scopes (Different value per
store_id
). Firstly I focus on the issues related tourl_key
andurl_path
.All the reported bugs appear when performing actions from API, some of them also appear when you perform actions manually in Admin Panel.
Work done
beforeSave
plugin, extractingUrlPathUpdate
to separate Service classCategoryRepository
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
✔️ Bug 1: Copy value instead of removing (API)
Category A
url_key
forStore X
tocategory-z
url_key
touse_default
forStore X
(At this point the result is correct:
url_key
returnscategory-a
)url_key
for Global Scope tocategory-n
Expected:
url_key
returned forCategory A
inStore X
should becategory-n
Actual:
url_key
forCategory A
inStore X
iscategory-a
✔️ Bug 2: Override global's scope
url_path
Note: When you update
url_key
, Magento should take care of all child categories in all affected scopes to updateurl_path
automatically according to your configuration.Category A
Subcategory B
underCategory A
url_key
forStore X
tocategory-z
Expected:
url_path
returned forSubcategory B
in Global scope should becategory-a/subcategory-b
, but forStore X
this should becategory-z/subcategory-b
Actual:
url_path
returned forSubcategory B
in Global scope iscategory-z/subcategory-b
The value is saved in Global scope in Database.
❌ Bug 3:
Category A
Subcategory B
underCategory A
url_key
forStore X
tocategory-z
url_key
touse_default
forStore X
Expected:
url_path
returned forSubcategory B
in Global scope should becategory-a/subcategory-b
Actual:
url_path
returned forSubcategory B
in Global scope iscategory-z/subcategory-b
Questions or comments
Contribution checklist (*)