Open Assambra opened 2 years ago
Hi @Assambra. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, review the Magento Contributor Assistant documentation.
Add a comment to assign the issue: @magento I am working on this
To learn more about issue processing workflow, refer to the Code Contributions.
Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
@magento give me 2.4-develop instance
Hi @engcom-November. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-November, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.
Verified the issue on Magento 2.4-develop branch but cannot able to reproduce the issue: Generated sitemap after setting the Product Category to Subcategory3 http://magento24.local/default/subcategory1/subcategory2/subcategory3.html sitemap.xml: Kindly recheck the issue on Magento 2.4-develop branch and provide missing steps if any if the issue is still reproducible.
Thank you.
Thank you for working on this issue. What i see is on your sitemap.xml the default categorie are included this is not the issue i descriped but is this a new issue? You are sure that the sitemap.xml is correct for the rewrite picture?
Step to reproduce the issue: Create three categories -> Category1 Category2 Category3 each as subcategory from the last one. Category1 |->Category2 |-->Category3
Create a product name it Product1 set the product category from this product to Subcategory3 (only) Create the sitemap
@magento give me 2.4-develop instance
Hi @engcom-November. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-November, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.
Hi @Assambra, I re-verified the issue again on Magento 2.4-develop branch with below Steps followed: 1 - Admin - Stores - Configuration - Catalog - Catalog - Search Engine Optimization - Use Categories Path for Product URLs is set to YES and Save config
Created Categories as below:
Created Product with only last sub category added as below:
Generated Sitemap
Category path is not included for product url in sitemap no matter even if all categories are assigned to the product and this is an existing behavior of Magento but not a bug.
Created a product with all categories assigned and generated sitemap:
@Assambra, I believe this is not a bug but the existing behavior of Magento. But as per your screenshot, Category path is included in sitemap.xml. Kindly confirm if you are using any third party extension in your setup. Kindly recheck the behavior on clean Magento 2.4-develop instance and provide missing steps if any if you are still facing any issues. Thank you.
I dont use any third party extension this is a clean magento 2.4.3-p1 installation on my server.
What is normal behaviour? if i enable Use Categories Path for Product it should show in your case http://magento24.local/default/product9.html Or it should show http://magento24.local/default/category1/category2/category3/product9.html Please clearify me!
in any case something isnt work correct on your or my or booth magento installation.
your Sitemap.xml pictures show one time alle categories and other time only url + product. why? I mean there is something incorrect and also i show you my result and have this problem on my production site and on the clean installed shop as i show you the pictures. My Sitemap creates in your example http://magento24.local/default/category1/category2/product9.html
What should it show?
greethings
@magento give me 2.4-develop instance
Hi @Assambra. Thank you for your request. I'm working on Magento instance for you.
Hi @Assambra, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.
@magento give me 2.4-develop instance
Hi @Assambra. Thank you for your request. I'm working on Magento instance for you.
Hi @Assambra, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.
As the behavior is different on Magento 2.4-develop branch, confirming the issue with updated description by adding additional information.
:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-2061 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
I decided to deal with this issue. The way @Assambra sees the solution to this issue was before. There was a call to such a method
And result was: product1.html subcategory1/product1.html subcategory1/subcategory2/product1.html subcategory1/subcategory2/subcategory3/product1.html
I decided to figure out why they did it the way it is now. I found pull request https://github.com/magento/magento2/pull/29184 for the next issue https://github.com/magento/magento2/issues/23363 in which explains why it should be so.
The main explanation for the irrelevance of this issue from https://github.com/magento/magento2/issues/23363 :
First problem As far as I know, the sitemap.xml files' only purpose is for search engines to use as they can then more easily find all important links to index a webshop. In this case, where Use Canonical Link Meta Tag For Products is set to Yes, we already indicate on product detail pages that search engines have to use the canonical url (which doesn't contain the category path) using a tag. But after #23129 got merged, the sitemap files contain product url's with the category path and not the canonical url's. So search engines will first find the non-canonical url, then look at the source code of that page, then find the canonical url, and then visit that url and remove the first page they found in the sitemap file from their index. This means at least 2 requests are made for every product on your shop from search engines which might cause more traffic/load then needed.
Second problem Magento added a new option Generate "category/product" URL Rewrites (via MC-4244) which is enabled by default, but when you disable it, Magento will no longer store category paths for product url's in the url_rewrite table in the database, but still allows you to see url's with the category path on the frontend as those url's are then build dynamically. Here it is expected that the sitemap files include the links being seen on the frontend even if they don't exist in the url_rewrite table, but the sitemap now uses the canonical links instead of the full url including the category path.
Preconditions (*)
Magento Commerce 2.4.3-p1, fresh installation and my production Site Missing 3th subcategory in sitemap. It generates a lot of trouble with SEO Canonical tag shows on -> https://www.example.com/Subcategory1/Subcategory2/Subcategory3/Product1 and Sitemap generates https://www.example.com/Subcategory1/Subcategory2/Product1
Edit: I don't know if that has anything to do with it, but if the URL rewrite ID plays a role. they are created incorrectly from the order. I am trying to explain id 1 https://www.example.com/Product1 id 2 https://www.example.com/Subcategory1/Subcategory2/Subcategory3/Product1 id 3 https://www.example.com/Subcategory1/Product1 id 4 https://www.example.com/Subcategory1/Subcategory2/Product1 <--It looks like the last ID are taken to generate the Sitemap
Ok it have to do with the url-rewrite ID i tryed by my self. Modify Product1 add it to Subcategory1 save, add to Subcategory2 save, add to Subcatagory3 save. The result is right order of url-rewrite ID and Sitmap works as expected and shows https://www.example.com/Subcategory1/Subcategory2/Subcategory3/Product1
It dosnt work if you select only the Subcategory3 or all Subcategories at the same time for the Product1
How can i fix that i got a lot of warning in Search console Duplicate - Submitted URL not set as canonical for this sitmap and i cannot fix 100 or more products by hand as i descriped earlyer.
Steps to reproduce (*)
Stores->Configuraton-Catalog->Catalog->Search Engine optimization
Set Use Categories Path for Product URLs -> Yes
Catalog-->Categories -> Create Three categories each as Subcategory from the last one. Default Categorie |>Subcategory1 |-->Subcategory2 |_--->Subcategory3
Catalog-->Products -> Create a product and name it Product1, set the Product Category to Subcategory3
Marketing->Site Map -> Create a new sitemap and generate it
Expected result (*)
Actual result (*)
Additional Information: 2.4-develop behavior: Category path is not included for product url in sitemap no matter even if all categories are assigned to the product:
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.