Skip to content

Sitemap creation missing last category #34797

Open
@Assambra

Description

@Assambra

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

  1. Set Use Categories Path for Product URLs -> Yes

  2. Catalog-->Categories -> Create Three categories each as Subcategory from the last one.
    Default Categorie
    |>Subcategory1
    |
    -->Subcategory2
    |_--->Subcategory3

  3. Catalog-->Products -> Create a product and name it Product1, set the Product Category to Subcategory3

  4. Marketing->Site Map -> Create a new sitemap and generate it

Expected result (*)

https://www.example.com/Subcategory1/Subcategory2/Subcategory3/Product1

Actual result (*)

https://www.eample.com/Subcategory1/Subcategory2/Product1

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:

image


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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: CatalogComponent: SitemapIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: ready for devReported on 2.4.3-p1Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions