vc-storefront
vc-storefront copied to clipboard
Sitemap Module Auto Rest Generate issue after upgrade platform 3.240
Please provide detailed information about your issue, thank you! Hi, I have upgraded my platform from 3.66 to 3.240 and now after generating auto rest of the sitemap module. In GenerateSitemapAsync in file SitemapController.cs I should get stream data type but I am getting data type string there is a conversion issue I am facing please tell me the best way to handle
Method ->
private async Task<Stream> TryGetSitemapStream(string filePath)
{
//If sitemap files have big size for generation on the fly you might place already generated xml files in the theme/assets folder or schedule
// execution of GenerateSitemapJob.GenerateStoreSitemap method for pre-generation sitemaps
var stream = await _liquidThemeEngine.GetAssetStreamAsync(filePath);
if (stream == null)
{
var absUrl = UrlBuilder.ToAppAbsolute("~/", WorkContext.CurrentStore, WorkContext.CurrentLanguage);
var storeUrl = new Uri(WorkContext.RequestUrl, absUrl).ToString();
//remove language from base url SitemapAPI will add it automatically
storeUrl = storeUrl.Replace("/" + WorkContext.CurrentLanguage.CultureName + "/", "/");
stream = await _siteMapApi.GenerateSitemapAsync(WorkContext.CurrentStore.Id, storeUrl, filePath) as Stream;
}
return stream;
}
Version info:
- Platform version: 3.240
Expected behavior
It should generate auto rest with stream data type
Actual behavior
it generates auto rest with string in GenerateSitemapAsync
Steps to reproduce
- Generate Autorest for latest Sitemap Module in storefront
- When you will try to build it will give an error in file SitemapController.cs Method Name TryGetSitemapStream
Task https://virtocommerce.atlassian.net/browse/VP-8175 has been created
Hi @OlegoO, Please suggest any solution for this
Hi @Koshalgarg155 ! Try the workaround described here: https://www.virtocommerce.org/t/client-cant-run-autorest-on-the-platform-itself-fatal-system-argumentnullexception-value-cannot-be-null/513
HI @Dan-BV, I am facing an issue with the auto rest of the sitemap module only. After generating auto rest of sitemap, In the generate sitemap async I am getting return type string instead of stream
Thanks for the response