Skip to content

Commit

Permalink
Merge pull request #22 from dynamicweb/dbe/18483-Fix-custom-fields-va…
Browse files Browse the repository at this point in the history
…lues-export

Fix export custom fields values
  • Loading branch information
frederik5480 authored Apr 3, 2024
2 parents c3357f7 + 74af043 commit 484bd48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>10.0.12</Version>
<Version>10.0.13</Version>
<AssemblyVersion>1.0.0</AssemblyVersion>
<Title>Excel Provider</Title>
<Description>Excel Provider</Description>
Expand Down
5 changes: 4 additions & 1 deletion src/ExportDataToExcelProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ private string GetTranslatedValue(object value, string systemName)
if (value is not null && value.ToString()?.Split(",") is string[] options)
{
var fieldOptions = Ecommerce.Services.FieldOptions.GetOptionsByFieldIdAndValues(systemName, options.ToHashSet());
return string.Join(",", fieldOptions.Select(fo => fo.Translations.Get(Ecommerce.Services.Languages.GetDefaultLanguageId()).Name));
if (fieldOptions.Any())
{
return string.Join(",", fieldOptions.Select(fo => fo.Translations.Get(Ecommerce.Services.Languages.GetDefaultLanguageId()).Name));
}
}
return Converter.ToString(value);
}
Expand Down

0 comments on commit 484bd48

Please sign in to comment.