From bb80177a02a30440b3bf5918ebd29544ee76dc97 Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Tue, 31 May 2022 15:18:20 +0200 Subject: [PATCH] Fixes #4103 - Reporting export file shows empty fields in selected columns when "custom sort option" is enabled. --- lib/excel_sheet.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/excel_sheet.rb b/lib/excel_sheet.rb index 69d8afc62..e8a0b577c 100644 --- a/lib/excel_sheet.rb +++ b/lib/excel_sheet.rb @@ -156,10 +156,11 @@ class ExcelSheet record end case object[:data_type] - when 'boolean', 'select' - if object[:data_option] && object[:data_option]['options'] && object[:data_option]['options'][value] - value = object[:data_option]['options'][value] + when 'boolean', %r{^(multi|tree_)?select$} + if object[:data_option].present? && object[:data_option]['options'].present? + value = ObjectManager::Attribute.data_options_hash(object[:data_option]['options'])[value] end + @worksheet.write_string(@current_row, @current_column, value) if value.present? when 'datetime' @worksheet.write_date_time(@current_row, @current_column, timestamp_in_localtime(value), @format_time) if value.present?