Bug #62075 – Export to CSV for fields of type TEXT is not working properly

When you export data to CSV, fields of type "text" that contain, for example, the characters "new line" create problems at the import stage on the Excel worksheet. Below is the patch file to apply to include/export_utils.php.

You could follow the bug by http://www.sugarcrm.com/support/bugs.html#issue_62075

From 3249d7de911089e70929b7630240dc256288ac5f Fri, 29 Mar 2013 00:00:43 +0100
From: Antonio Musarra <antonio.musarra@gmail.com>
Date: Wed, 20 Mar 2013 10:39:32 +0100
Subject: [PATCH] Bug #62075 - Export to CSV for fields of type TEXT is not working properly

diff --git a/include/export_utils.php b/include/export_utils.php
index 1e4f5e3..e2d8fcf 100644
--- a/include/export_utils.php
+++ b/include/export_utils.php
@@ -312,6 +312,10 @@
                             $value = implode(",",$valueArray);
                         }
                         break;
+                    // Bug 62075 - Export to CSV for fields of type TEXT is not working properly
+                    case 'text':
+                       $value = trim(preg_replace('/ss+/', ' ', $value));
+                       break;
                 }
             }

Antonio Musarra

I began my journey into the world of computing from an Olivetti M24 PC (http://it.wikipedia.org/wiki/Olivetti_M24) bought by my father for his work. Day after day, quickly taking control until … Now doing business consulting for projects in the enterprise application development using web-oriented technologies such as J2EE, Web Services, ESB, TIBCO, PHP.

You may also like...