You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we found a bug related to the sitemap detail URLs.
The listing display works correctly. However, the detail of a sitemap URL always returns the first cached result.
In SitemapController.php the actionDetail call the SeoFields::$plugin->sitemapSerivce->getSitemapData service method. You got a typo in sitemapSerivce :)
Inside getSitemapData() method :
if (!Craft::$app->getConfig()->general->devMode) {
$data = Craft::$app->getCache()->getOrSet(
'',
function () use ($data, $type, $settings, $sectionId) {
return $this->_addElementsToSitemap($data, $settings[$type][$sectionId]);
},
null,
$cacheDependency
);
} else {
$data = $this->_addElementsToSitemap($data, $settings[$type][$sectionId]);
}
It's working great locally cause I'm in devmode. But not in the stating and prod environment.
I think the problem is the empty cache_key.
So, if a request /sitemap_1_entry_5_aluminium_single.xml it's working great. But if I request /sitemap_1_entry_4_about_single.xml, I got the same result as the first request url call.
I fix it by removing the condition Craft::$app->getConfig()->general->devMode directly in the vendor code. But it's not a good solution.
I think the solution is to use a valid cache_key. ex : self::SITEMAP_CACHE_KEY . "" . $siteId . "" . $sectionId.
Thank you !
The text was updated successfully, but these errors were encountered:
Hi,
I think we found a bug related to the sitemap detail URLs.
The listing display works correctly. However, the detail of a sitemap URL always returns the first cached result.
In SitemapController.php the actionDetail call the SeoFields::$plugin->sitemapSerivce->getSitemapData service method. You got a typo in sitemapSerivce :)
Inside getSitemapData() method :
It's working great locally cause I'm in devmode. But not in the stating and prod environment.
I think the problem is the empty cache_key.
So, if a request /sitemap_1_entry_5_aluminium_single.xml it's working great. But if I request /sitemap_1_entry_4_about_single.xml, I got the same result as the first request url call.
I fix it by removing the condition Craft::$app->getConfig()->general->devMode directly in the vendor code. But it's not a good solution.
I think the solution is to use a valid cache_key. ex : self::SITEMAP_CACHE_KEY . "" . $siteId . "" . $sectionId.
Thank you !
The text was updated successfully, but these errors were encountered: