-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Category path is the same as key producing duplicate URL issue #14080
Comments
This looks like it could be related to issue #7298 |
Hi @AaronKaa. Thank you for report. |
I cant confirm that - the store itself has been updated from magento 2.1.5 and the data was imported via rest api (I should have mentioned that in the initial post), at this point were almost ready to go live with a new store. |
We've found that editing the category using the api doesn't have this effect so we're going to do it that way for now. |
@AaronKaa please more describe steps to reproduce the issue |
We imported all of the categories and products via the REST API on version 2.1.5 |
I'm working with AaronKaa on this project. I think it's related to products added via the REST API. The url is at first correct, so say the parent category was called "Example" with the url key "example" we'd get: "/example/test". But if we then try to change the url key of the test category either in the backend or via the api to something like "test-changed" we'd expect the new url path to be "/example/test-changed" but instead it becomes just "/test". So it looks like the url path is being set as the url key. This is happening with deeper categories as well. Categories that were created manually in the backend and not with the api do not produce this result and work correctly however. |
Hi @AaronKaa and @Lycanite
{
"category": {
"name": "Test category 2",
"parent_id":"3", /* Test category 1 */
"is_active":"true",
"include_in_menu": true,
"level":"2",
"custom_attributes": [{ "attribute_code": "url_key", "value": "test-category-2" }]
}
} At now we have the url_key: "test-category-1" and path: "/test-category-1/test-category-2".
Expected result:Category "Test category 2" has attribute values: Actual result:Category "Test category 2" has attribute values: |
@AaronKaa, thank you for your report. |
Looking at this further Ive found that the issue is the category level - manually re-setting the level to its correct value in the database and regenerating the urls fixed the issue |
Hi @engcom-Echo. Thank you for working on this issue.
|
✅ Confirmed by @engcom-Echo Issue Available: @engcom-Echo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
Hi @sergiy-v. Thank you for working on this issue.
|
…op expedited Accepted Community Pull Requests: - #27298: Implement ActionInterface for `cms/page/view` (by @lbajsarowicz) - #27116: Add Italy States (by @WaPoNe) - #26748: #26745 add method setAdditionalInformation to OrderPaymentInte… (by @antoninobonumore) - #27336: fixed My account Address Book Additional Address Entries table issue #27335 (by @abrarpathan19) - #27263: #26708 Fix: ORDER BY has two similar conditions in the SQL query (by @vasilii-b) - #27304: FIX #14080 Added improvements to Category repository (save method) (by @sergiy-v) - #27214: Mark AbstractAccount as DEPRECATED for Magento_Customer controllers (by @lbajsarowicz) - #27292: Magento_Bundle / Remove `cache:flush` and extract Tests to separate files (by @lbajsarowicz) Fixed GitHub Issues: - #26708: ORDER BY has two similar conditions (reported by @Usik2203) has been fixed in #27263 by @vasilii-b in 2.4-develop branch Related commits: 1. 1e1ebd3 2. df35dda 3. b816334 4. a61d92a
Preconditions
Magento 2.4
Ubuntu 18.04
Steps to Reproduce
Name: Test category 1, Url key: test-category-1.
level = 2
by res api:/V1/categories
At now we have the url_key: "test-category-1" and path: "/test-category-1/test-category-2".
Expected result:
Category "Test category 2" has attribute values:
url_key: "test-category-2-changed"
url_path: "/test-category-1/test-category-2-changed"
Actual result:
Category "Test category 2" has attribute values:
url_key: "test-category-2-changed"
url_path: "test-category-2-changed"
Note
When I try to change a category url key, it changes the path to be identical which results in an error being raised and short category urls which don't include its parent, it has now affected categories that I haven't explicitly changed/saved.
(table
catalog_category_entity_varchar
)As you can see from the screen shot (with url_key, attribute_id 117 and url_path, attribute_id 118) the mens-footwear category has been affected but not the womens-footwear category.
The text was updated successfully, but these errors were encountered: