Author: jablko
Date: Wed Oct 27 23:50:50 2010
New Revision: 8603

Log:
Make root actor the parent of new repositories, fixes issue 1849

Modified:
   trunk/apps/qubit/modules/repository/actions/editAction.class.php
   trunk/apps/qubit/modules/repository/actions/indexAction.class.php
   
trunk/plugins/sfIsaarPlugin/modules/sfIsaarPlugin/actions/relatedAuthorityRecordComponent.class.php

Modified: trunk/apps/qubit/modules/repository/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/repository/actions/editAction.class.php    Wed Oct 
27 23:40:50 2010        (r8602)
+++ trunk/apps/qubit/modules/repository/actions/editAction.class.php    Wed Oct 
27 23:50:50 2010        (r8603)
@@ -34,10 +34,20 @@
     $this->form->getValidatorSchema()->setOption('allow_extra_fields', true);
 
     $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;
 
+      // Check that this isn't the root
+      if (!isset($this->resource->parent))
+      {
+        $this->forward404();
+      }
+
       // Check user authorization
       if (!QubitAcl::check($this->resource, 'update'))
       {

Modified: trunk/apps/qubit/modules/repository/actions/indexAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/repository/actions/indexAction.class.php   Wed Oct 
27 23:40:50 2010        (r8602)
+++ trunk/apps/qubit/modules/repository/actions/indexAction.class.php   Wed Oct 
27 23:50:50 2010        (r8603)
@@ -22,5 +22,11 @@
   public function execute($request)
   {
     $this->resource = $this->getRoute()->resource;
+
+    // Check that this isn't the root
+    if (!isset($this->resource->parent))
+    {
+      $this->forward404();
+    }
   }
 }

Modified: 
trunk/plugins/sfIsaarPlugin/modules/sfIsaarPlugin/actions/relatedAuthorityRecordComponent.class.php
==============================================================================
--- 
trunk/plugins/sfIsaarPlugin/modules/sfIsaarPlugin/actions/relatedAuthorityRecordComponent.class.php
 Wed Oct 27 23:40:50 2010        (r8602)
+++ 
trunk/plugins/sfIsaarPlugin/modules/sfIsaarPlugin/actions/relatedAuthorityRecordComponent.class.php
 Wed Oct 27 23:50:50 2010        (r8603)
@@ -34,7 +34,7 @@
     switch ($name)
     {
       case 'type':
-        $this->form->setValidator('type', new sfValidatorString);
+        $this->form->setValidator('type', new 
sfValidatorString(array('required' => true)));
 
         $choices = array();
         $choices[null] = null;

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