Author: david
Date: Mon Feb 13 17:47:10 2012
New Revision: 10879

Log:
Fix bug with repository assignment

Modified:
   trunk/lib/QubitSearchPdo.class.php

Modified: trunk/lib/QubitSearchPdo.class.php
==============================================================================
--- trunk/lib/QubitSearchPdo.class.php  Mon Feb 13 17:40:02 2012        (r10878)
+++ trunk/lib/QubitSearchPdo.class.php  Mon Feb 13 17:47:10 2012        (r10879)
@@ -170,20 +170,17 @@
     foreach (self::$statement->fetchAll(PDO::FETCH_OBJ) as $i => $resource)
     {
       $this->counter++;
+      $thisOptions = $options;
 
       // Set repository
       if (null != $resource->repository_id)
       {
-        $repository = QubitRepository::getById($resource->repository_id);
-
-        // Pass repository down hierarchy
-        self::addInformationObjectIndex($resource, $ancestors, $options + 
array('repository' => $repository));
-      }
-      else
-      {
-        self::addInformationObjectIndex($resource, $ancestors, $options);
+        $thisOptions = $options + array('repository' => 
QubitRepository::getById($resource->repository_id));
       }
 
+      // Add current resource
+      self::addInformationObjectIndex($resource, $ancestors, $thisOptions);
+
       // Log
       $this->getLogger()->log('"'.$resource->title.'" inserted 
('.round(microtime(true) - self::$startTime, 2).'s) 
('.($this->counter).'/'.self::$infoObjectCount.')', $this->getName());
 
@@ -191,7 +188,7 @@
       if ((1 < intval($resource->rgt) - intval($resource->lft))
         && $resource->culture == $resource->source_culture)
       {
-        $this->indexInformationObjects(array_merge($ancestors, 
array($resource)), $options);
+        $this->indexInformationObjects(array_merge($ancestors, 
array($resource)), $thisOptions);
       }
     }
   }

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