Skip to content

Sitemap in robots.txt not store specific #28901

Closed
@medialoungeml

Description

@medialoungeml

Preconditions (*)

  1. Magento CE 2.3.3
    Magento 2.4 and 2.3.5-p1

Steps to reproduce (*)

  1. Create Second Web Site, Store and Store View
  2. Go to Stores -> Configuration -> General -> Web
  3. Set "Add Store Code to Urls" = "Yes" -> Save
  4. Go to Stores -> Configuration -> Catalog -> XML Sitemap
  5. Expand "Generation Settings" section
  6. Set "Enabled" = "Yes"
  7. Expand "Search Engine Submission Settings" section
  8. Set "Enable Submission to Robots.txt" = "Yes" -> Save
  9. Run php bin/magento cron:run and php bin/magento c:f
  10. Go to Marketing -> Site Map
  11. Create 2 Site Maps (one for Default site and another one for second with different "Filename"
    Screenshot_14
  12. Save & Generate
  13. Run php bin/magento cron:run and php bin/magento c:f
  14. Go to store view and open Default store (http://youredomain.local/robots.txt)
  15. Then in new tab open Second store (http://youredomain.local/de/robots.txt)

Expected result (*)

Site Maps should be different (because of different Filename)
The Sitemap: property should be retrieved within the context of the store

Actual result (*)

Site Maps are the same
Screenshot_13

Proposed Solution

The Sitemap value is retrieved in Magento\Sitemap\Block\Robots::_toHtml() and within this function the \Magento\Store\Model\StoreManagerInterface::getDefaultStoreView() is called to get the list of store ids to generate the sitemap for, this results in the value for the default store only ever being returned.
Here is comment with posible fix the issue

Note In Content -> Design -> Configuration you can configure the file settings robots.txt

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.
  • [ X ] 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

Labels

Component: SitemapFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P3May be fixed according to the position in the backlog.Progress: doneReported on 2.3.3Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S2Major restrictions or short-term circumventions are required until a fix is available.Triage: DoneHas been reviewed and prioritized during Triage with Product Managers

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions