Author: mcantelon
Date: Thu Aug 23 13:53:23 2012
New Revision: 12178

Log:
Removed incorrect implementations of CLI options for setting parents.

Modified:
   trunk/lib/task/import/csvImportTask.class.php

Modified: trunk/lib/task/import/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/import/csvImportTask.class.php       Thu Aug 23 13:35:38 
2012        (r12177)
+++ trunk/lib/task/import/csvImportTask.class.php       Thu Aug 23 13:53:23 
2012        (r12178)
@@ -400,26 +400,16 @@
           throw new sfException('Both parentId and qubitParentSlug are set: 
only one should be set.');
         }
 
-        // if a parent slug has been specified in the row or via the 
command-line, attempt lookup
         if (
-          (
-            isset($self->rowStatusVars['qubitParentSlug'])
-            && $self->rowStatusVars['qubitParentSlug']
-          )
-          || $self->status['options']['parent-slug']
+          isset($self->rowStatusVars['qubitParentSlug'])
+          && $self->rowStatusVars['qubitParentSlug']
         )
         {
-          // if a parent slug is specified by the command-line, that will
-          // override any parent slug specified in the current CSV row
-          $parentSlug = ($self->status['options']['parent-slug'])
-            ? $self->status['options']['parent-slug']
-            : $self->rowStatusVars['qubitParentSlug'];
-
           $query = "SELECT object_id FROM slug WHERE slug=?";
 
           $statement = QubitFlatfileImport::sqlQuery(
             $query,
-            array($parentSlug)
+            array($self->rowStatusVars['qubitParentSlug'])
           );
 
           $result = $statement->fetch(PDO::FETCH_OBJ);
@@ -428,17 +418,10 @@
           {
             $parentId = $result->object_id;
           } else {
-            throw new sfException('Could not find information object matching 
slug "'. $parentSlug .'"');
+            throw new sfException('Could not find information object matching 
slug "'. $self->rowStatusVars['qubitParentSlug'] .'"');
           }
         } else {
-          // if a legacy parent ID hasn't been specified in the row or via the 
commandline, don't lookup
-          if (
-            (
-              !isset($self->rowStatusVars['parentId'])
-              || !$self->rowStatusVars['parentId']
-            )
-            && !$self->status['options']['legacy-parent-id']
-          )
+          if (!isset($self->rowStatusVars['parentId']) || 
!$self->rowStatusVars['parentId'])
           {
             // Don't overwrite valid parentId when adding an i18n row
             if (!isset($self->object->parentId))
@@ -446,15 +429,8 @@
               $parentId = QubitInformationObject::ROOT_ID;
             }
           } else {
-            // if a legacy parent ID is specified by the command-line, that 
will
-            // override any legacy parent ID specified in the current CSV row
-            $legacyParentId = ($self->status['options']['legacy-parent-id'])
-              ? $self->status['options']['legacy-parent-id']
-              : $self->rowStatusVars['parentId'];
-
-            // lookup Qubit parent ID using legacy parent ID
             if ($mapEntry = $self->fetchKeymapEntryBySourceAndTargetName(
-              $legacyParentId,
+              $self->rowStatusVars['parentId'],
               $self->getStatus('sourceName'),
               'information_object'
             ))
@@ -464,7 +440,7 @@
               $error = 'For legacyId '
                 . $self->rowStatusVars['legacyId']
                 .' Could not find parentId '
-                . $legacyParentId
+                . $self->rowStatusVars['parentId']
                 .' in key_map table';
               print $self->logError($error);
             }

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