vc-storefront icon indicating copy to clipboard operation
vc-storefront copied to clipboard

Sitemap Module Auto Rest Generate issue after upgrade platform 3.240

Open Koshalgarg155 opened this issue 2 years ago • 4 comments

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

  1. Generate Autorest for latest Sitemap Module in storefront
  2. When you will try to build it will give an error in file SitemapController.cs Method Name TryGetSitemapStream

Koshalgarg155 avatar Sep 02 '22 09:09 Koshalgarg155

Task https://virtocommerce.atlassian.net/browse/VP-8175 has been created

mvktsk avatar Sep 02 '22 10:09 mvktsk

Hi @OlegoO, Please suggest any solution for this

Koshalgarg155 avatar Sep 05 '22 10:09 Koshalgarg155

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

Dan-BV avatar Sep 12 '22 07:09 Dan-BV

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

Koshalgarg155 avatar Sep 13 '22 06:09 Koshalgarg155