Author: david
Date: Tue Jul 31 08:12:46 2012
New Revision: 12017

Log:
Trim leading/trailing whitespace

Modified:
   trunk/lib/QubitFlatfileImport.class.php

Modified: trunk/lib/QubitFlatfileImport.class.php
==============================================================================
--- trunk/lib/QubitFlatfileImport.class.php     Tue Jul 31 08:01:36 2012        
(r12016)
+++ trunk/lib/QubitFlatfileImport.class.php     Tue Jul 31 08:12:46 2012        
(r12017)
@@ -618,6 +618,9 @@
     // process import columns that don't produce child data
     $this->forEachRowColumn($row, function(&$self, $index, $columnName, $value)
     {
+      // Trim whitespace
+      $value = trim($value);
+
       // if column maps to an attribute, set the attribute
       if (isset($self->columnMap) && isset($self->columnMap[$columnName]))
       {
@@ -627,7 +630,7 @@
       else if (
         isset($self->propertyMap)
         && isset($self->propertyMap[$columnName])
-        && trim($value)
+        && $value
       )
       {
         $self->object->addProperty(
@@ -649,7 +652,7 @@
       else if (
         isset($self->columnNames[$index])
         && in_array($self->columnNames[$index], $self->standardColumns)
-        && trim($value)
+        && $value
       )
       {
         // otherwise, if column is data and it's a standard column, use it
@@ -670,7 +673,10 @@
   {
     $this->forEachRowColumn($row, function(&$self, $index, $columnName, $value)
     {
-      if (isset($self->noteMap) && isset($self->noteMap[$columnName]) && 
trim($value))
+      // Trim whitespace
+      $value = trim($value);
+
+      if (isset($self->noteMap) && isset($self->noteMap[$columnName]) && 
$value)
       {
         // otherwise, if maps to a note, create it
         $transformationLogic = 
(isset($self->noteMap[$columnName]['transformationLogic']))

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to