Author: david
Date: Thu Oct 28 16:50:39 2010
New Revision: 8642

Log:
Transparently root repositories like r8603.

Modified:
   trunk/apps/qubit/modules/repository/actions/editAction.class.php
   trunk/lib/model/QubitRepository.php

Modified: trunk/apps/qubit/modules/repository/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/repository/actions/editAction.class.php    Thu Oct 
28 16:48:11 2010        (r8641)
+++ trunk/apps/qubit/modules/repository/actions/editAction.class.php    Thu Oct 
28 16:50:39 2010        (r8642)
@@ -35,9 +35,6 @@
 
     $this->resource = new QubitRepository;
 
-    // Make root actor the parent of new repositories
-    $this->resource->parentId = QubitActor::ROOT_ID;
-
     if (isset($this->getRoute()->resource))
     {
       $this->resource = $this->getRoute()->resource;

Modified: trunk/lib/model/QubitRepository.php
==============================================================================
--- trunk/lib/model/QubitRepository.php Thu Oct 28 16:48:11 2010        (r8641)
+++ trunk/lib/model/QubitRepository.php Thu Oct 28 16:50:39 2010        (r8642)
@@ -25,6 +25,16 @@
  */
 class QubitRepository extends BaseRepository
 {
+  public function save($connection = null)
+  {
+    if (self::ROOT_ID != $this->id && !isset($this->parentId) && 
'QubitRepository' == $this->className)
+    {
+      $this->parentId = self::ROOT_ID;
+    }
+
+    parent::save($connection);
+  }
+
   /**
    * Save new link to a term.
    *

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