Closed
Description
Preconditions (*)
- Magento CE 2.3.3
Magento 2.4 and 2.3.5-p1
Steps to reproduce (*)
- Create Second Web Site, Store and Store View
- Go to Stores -> Configuration -> General -> Web
- Set "Add Store Code to Urls" = "Yes" -> Save
- Go to Stores -> Configuration -> Catalog -> XML Sitemap
- Expand "Generation Settings" section
- Set "Enabled" = "Yes"
- Expand "Search Engine Submission Settings" section
- Set "Enable Submission to Robots.txt" = "Yes" -> Save
- Run
php bin/magento cron:run
andphp bin/magento c:f
- Go to Marketing -> Site Map
- Create 2 Site Maps (one for Default site and another one for second with different "Filename"
- Save & Generate
- Run
php bin/magento cron:run
andphp bin/magento c:f
- Go to store view and open Default store (http://youredomain.local/robots.txt)
- 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 (*)
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
Assignees
Labels
The issue has been fixed in 2.4-develop branchGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentMay be fixed according to the position in the backlog.Indicates original Magento version for the Issue report.The issue has been reproduced on latest 2.4-develop branchMajor restrictions or short-term circumventions are required until a fix is available.Has been reviewed and prioritized during Triage with Product Managers
Type
Projects
Status
Done