Skip to content

Commit 36a5965

Browse files
authored
ENGCOM-5844: Fixes problem with wrong image URL in sitemap #24605
2 parents 320023e + 1e7ab11 commit 36a5965

File tree

1 file changed

+6
-0
lines changed
  • app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap

1 file changed

+6
-0
lines changed

app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Generate.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,13 @@ public function execute()
4949
// if sitemap record exists
5050
if ($sitemap->getId()) {
5151
try {
52+
$this->appEmulation->startEnvironmentEmulation(
53+
$sitemap->getStoreId(),
54+
\Magento\Framework\App\Area::AREA_FRONTEND,
55+
true
56+
);
5257
$sitemap->generateXml();
58+
$this->appEmulation->stopEnvironmentEmulation();
5359
$this->messageManager->addSuccessMessage(
5460
__('The sitemap "%1" has been generated.', $sitemap->getSitemapFilename())
5561
);

0 commit comments

Comments
 (0)