From edb29977dd35d9999195b8f3e2133259e8341895 Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Sun, 7 Jul 2024 09:03:50 +0300 Subject: [PATCH] skip field description --- lib/templates/find_acro_fields.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/templates/find_acro_fields.rb b/lib/templates/find_acro_fields.rb index eba9d4e05..f686ddd51 100644 --- a/lib/templates/find_acro_fields.rb +++ b/lib/templates/find_acro_fields.rb @@ -5,6 +5,7 @@ module FindAcroFields PDF_CONTENT_TYPE = 'application/pdf' FIELD_NAME_REGEXP = /\A(?=.*\p{L})[\p{L}\d\s]+\z/ + SKIP_FIELD_DESCRIPTION = %w[undefined].freeze module_function @@ -103,7 +104,9 @@ def build_field_properties(field) field_name = field_name&.encode('utf-8', invalid: :replace, undef: :replace, replace: '') attrs = { name: field_name.to_s } - attrs[:description] = field[:TU] if field[:TU].present? && field[:TU] != field.full_field_name + attrs[:description] = field[:TU] if field[:TU].present? && + field[:TU] != field.full_field_name && + !field[:TU].in?(SKIP_FIELD_DESCRIPTION) if field.field_type == :Btn && field.concrete_field_type == :radio_button && field[:Opt].present? selected_option_index = (field.allowed_values || []).find_index(field.field_value)