Don't miss out Virtual Happy Hour this Friday (April 26).
Don't miss out Virtual Happy Hour this Friday (April 26).
Jun 15, 2018
Oct 12, 2018
Closed, Fixed and tested
Product version: EPiServer.ServiceApi.Commerce 5.0.0
PIM-system fails.
The problem occurs when you fetch an entry with all values from all languages. If one language does not have a value, it skips all subsequent languages. For example, you have an entry with 10 languages: SV, DA, DE, EN, ES, FI, FR, KO, NL, NO. All languages have a value for the metadata "DisplayName" except ES.
When I fetch this entry, and look at "DisplayName" in the meta fields, I only see values for SV, DA, DE, EN.
Because ES doesn't have a value, it also skips FI, FR, KO, NL, NO.
Here is where the error occurs:
EPiServer.ServiceApi.Commerce.Controllers.Catalog.Construction.MetaDataModelFactory:
protected List<MetaFieldData> GetValues(MetaField metaField, IEnumerable<CatalogContentBase> contents) { List<MetaFieldData> list = new List<MetaFieldData>(); foreach (CatalogContentBase content in contents) { object obj = content.Property[metaField.Name]?.Value; if (obj == null) { *return list; * } ... }
The error is the bold line. The return; breaks the foreach-loop and only returns values before this occurred.
It should be a continue; instead.