From 89fb49618df8db15ebba68fee7a2c52b363ea39e Mon Sep 17 00:00:00 2001
From: aydreeihn <adriane@enhancesoft.com>
Date: Wed, 2 Jan 2019 16:58:17 -0600
Subject: [PATCH] Issue: Attachments on Information Fields

This commit fixes an issue where we failed to upload attachments on Information Fields. In the to_config function, we were only taking the array_values of attachments which would return an array with only the file name ([0] => 'filename') instead of an array with the file id and file name ([123] => 'filename').

Now, when we pass the keepers to keepOnlyFileIds, we have a file id that can be passed to the upload function.
---
 include/class.forms.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/class.forms.php b/include/class.forms.php
index 2c3ec0da7..ae5103e05 100644
--- a/include/class.forms.php
+++ b/include/class.forms.php
@@ -4657,7 +4657,7 @@ class FreeTextField extends FormField {
 
     function to_config($config) {
         if ($config && isset($config['attachments']))
-            $keepers = $config['attachments'] = array_values($config['attachments']);
+            $keepers = $config['attachments'];
         $this->getAttachments()->keepOnlyFileIds($keepers);
 
         return $config;
-- 
GitLab