Author: david
Date: Fri Jul 13 16:25:54 2012
New Revision: 11922

Log:
Get multi-cultural import working... mostly.  Title is mysteriously missing in 
English description.

Modified:
   trunk/lib/QubitFlatfileImport.class.php

Modified: trunk/lib/QubitFlatfileImport.class.php
==============================================================================
--- trunk/lib/QubitFlatfileImport.class.php     Fri Jul 13 11:56:22 2012        
(r11921)
+++ trunk/lib/QubitFlatfileImport.class.php     Fri Jul 13 16:25:54 2012        
(r11922)
@@ -224,7 +224,7 @@
       }
     } else {
       throw new sfException('Invalid column "'. $column .'".');
-    } 
+    }
   }
 
   /**
@@ -498,11 +498,10 @@
       }
     }
 
-    // Default culture is English
-    $cultureKey = array_search('culture', $this->columnNames);
-    if (isset($cultureKey) && !isset($this->status['row'][$cultureKey]))
+    // Default culture to English
+    if (0 == strlen($this->columnValue('culture')))
     {
-      $this->status['row'][$cultureKey] = 'en';
+      $this->columnValue('culture','en');
     }
 
     // set row status variables that are based on column values
@@ -513,26 +512,24 @@
       $tableName = sfInflector::underscore(substr($this->className, 5));
 
       if ($mapEntry = $this->fetchKeymapEntryBySourceAndTargetName(
-        $this->status['row']['legacyId'],
+        $this->columnValue('legacyId'),
         $this->status['sourceName'],
         $tableName
       ))
       {
-        var_dump("Found id {$mapEntry->target_id}");
         // Lookup existing object
         $this->object = QubitInformationObject::getById($mapEntry->target_id);
 
         // Log error if object exists with current culture
-        if ($this->object->source_culture == $this->status['row']['culture'])
+        if ($this->object->sourceCulture == $this->columnValue('culture'))
         {
           print $this->logError(sprintf('Duplicate entry for information 
object id:%s, culture: %s',
             $this->object->id,
-            $this->object->source_culture));
+            $this->object->sourceCulture));
         }
       }
       else
       {
-        var_dump("Create new object!");
         // create new object
         $this->object = new $this->className;
       }

-- 
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