Developer forum

Forum » Development » Missing CountryCode in PIM Feed

Missing CountryCode in PIM Feed

Anders Ebdrup
Anders Ebdrup
Reply

Dear Dynamicweb,

 

We have upgraded a solution to 9.15.10 and afterwards we experience issues with a missing "countrycode" when trying to access a feed - please see this screendump: https://app.screencast.com/HwUloqRl3rakf. But when we add a countrycode parameter to the url the feed is working again...

I think that the issue arise from this commit: https://dev.azure.com/dynamicwebsoftware/_git/Dynamicweb/commit/4914743f64d005a76e0d939a0632602e6bf14e4b?refName=refs%2Fheads%2Fmain&_a=compare&path=%2Fsrc%2F77%20-%20Ecommerce%2FDynamicweb.Ecommerce%2FFeeds%2FFeedContextConfiguration.cs

 

Can you please try to look into it?

 

Best regards, Anders


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Not sure that is the change that causes this... Either way, a bug it seems to be:

Devops#15017, https://dev.azure.com/dynamicwebsoftware/Dynamicweb/_workitems/edit/15017/

BR Nicolai

Votes for this answer: 1
 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hi Anders,

I'm currently looking into this issue.
It seems that there are three situations which can lead to this error...

  1. Using an invalid country code in the URL (e.g. countrycode=xy).
    This doesn't seem to be the issue here.
     
  2. A solution without any countries at all.
    We cannot easily handle this situation unless we automatically create a country when no countries exist.
    Please ensure that you have at least one country, one language and one currency in the solution.
     
  3. A language has been configured with an invalid country code (regional settings).
    I think we should be able to handle this situation. I will take a closer look at that.
    For now you should make sure that the regional settings on each language matches an existing country (you can try to save each language and see if you get an error message).
    You can also try to execute the sql statement below to see if there is a mismatch (MissingCountry = 1).
SELECT LanguageId, LanguageIsDefault, LanguageCode2, (CASE WHEN CountryCode2 IS NULL THEN 1 ELSE 0 END) AS MissingCountry 
FROM EcomLanguages LEFT JOIN EcomCountries ON LanguageCode2 = CountryCode2

/Morten

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Morten,

 

Nicolai has already solved the coding error (the exception), but I think that we need to be able to select a country on the PIM feed setting, to have this totally solved. 

Will that be a possibility as you see it?

 

Best regards, Anders

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

An attempt was made to solve this issue, but I don't think that any bugfix has been released yet.
Does it work for you now? You don't get the exception anymore?
If this is no longer an issue then I'll close the bug and register a new feature request for country settings on feeds.

/Morten

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Morten,

 

Your are right - we are still awaiting the bugfix :-) So please do not close the issue before it is verified and solved for good!

 

Best regards, Anders

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

I have implemented a fix to avoid the exception when a language has been configured with invalid regional settings which doesn't match an existing country (awaiting approval from QA):
Bug 15017: Missing CountryCode in PIM Feed - exception

I would still recommend that all languages are configured with valid regional settings (matching country codes of existing countries). Otherwise, the system will just fallback to using the first country it can find - which can result in unexpected prices, discounts, etc. in feeds and other product related web api endpoints.
When fetching feeds (or products in general) from the web api I would recommend that you pass a valid country code in the request, if possible, to ensure that you get the expected result.
A country is required for all price calculations.

A separate feature has been registered for extending the feed configuration screen with selectable countries:
Feature 15195: Feeds - Possibility to select countries on PIM feeds

/Morten

 
Anders Ebdrup
Anders Ebdrup
Reply

Sounds great! Thank you, Morten!

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply

Hi Anders

Bugfix #15017 regarding the Missing CountryCode now fixed and released in Dynamicweb version 9.15.13

Get this from the download section https://doc.dynamicweb.dk/downloads/dynamicweb-9

Kind Regards
Dynamicweb Care Support
Kristian Kirkholt

 

You must be logged in to post in the forum