From b002820991f3f93d5c9ba6a2c020da585322e2de Mon Sep 17 00:00:00 2001 From: "karel.picman@lbcfree.net" Date: Tue, 10 Aug 2021 08:37:31 +0200 Subject: [PATCH] Custom field not set as default column #1277 --- app/models/dmsf_query.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/models/dmsf_query.rb b/app/models/dmsf_query.rb index 5220379e..d99fa747 100644 --- a/app/models/dmsf_query.rb +++ b/app/models/dmsf_query.rb @@ -67,8 +67,13 @@ class DmsfQuery < Query columns = available_columns if columns columns.each do |column| - if DmsfFolder.is_column_on?(column.name.to_s) - @default_column_names << column.name.to_sym + if column.is_a?(QueryCustomFieldColumn) + name = column.custom_field.name + else + name = column.name.to_s + end + if DmsfFolder.is_column_on?(name) + @default_column_names << column.name end end end