Author: david
Date: Thu Aug  2 13:56:54 2012
New Revision: 12030

Log:
Get note i18n update (r12021) working

Modified:
   trunk/lib/QubitFlatfileImport.class.php

Modified: trunk/lib/QubitFlatfileImport.class.php
==============================================================================
--- trunk/lib/QubitFlatfileImport.class.php     Thu Aug  2 00:02:35 2012        
(r12029)
+++ trunk/lib/QubitFlatfileImport.class.php     Thu Aug  2 13:56:54 2012        
(r12030)
@@ -673,9 +673,6 @@
   {
     $this->forEachRowColumn($row, function(&$self, $index, $columnName, $value)
     {
-      // Trim whitespace
-      $value = trim($value);
-
       if (isset($self->noteMap) && isset($self->noteMap[$columnName]) && 
$value)
       {
         // otherwise, if maps to a note, create it
@@ -870,7 +867,6 @@
    */
   public function createOrUpdateNotes($typeId, $textArray, 
$transformationLogic = false)
   {
-    $notes = array();
     $noteIds = array();
 
     // I18n row handler
@@ -889,6 +885,7 @@
 
     foreach($textArray as $i => $text)
     {
+      QubitNote::clearCache();
       $options = array();
 
       if ($transformationLogic)
@@ -901,10 +898,9 @@
         $options['noteId'] = $noteIds[$i];
       }
 
-      $notes[] = $this->createOrUpdateNote($typeId, $text, $options);
-    }
+      $this->createOrUpdateNote($typeId, $text, $options);
 
-    return $notes;
+    }
   }
 
   /**
@@ -918,6 +914,9 @@
    */
   public function createOrUpdateNote($typeId, $text, $options = array())
   {
+    // Trim whitespace
+    $text = trim($text);
+
     if (isset($options['noteId']))
     {
       $note = QubitNote::getById($options['noteId']);
@@ -936,6 +935,7 @@
     }
 
     $note->content = $this->content($text);
+    $note->culture = $this->columnValue('culture');
     $note->save();
 
     return $note;

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