Author: david
Date: Tue Oct 20 13:47:46 2009
New Revision: 3776

Log:
After info object delete, redirect to show page for parent object if one 
exists; if no parent exists (e.g. parent is root object) then redirect to list 
page. Fixes issue #1063.

Modified:
   trunk/apps/qubit/modules/informationobject/actions/deleteAction.class.php

Modified: 
trunk/apps/qubit/modules/informationobject/actions/deleteAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/deleteAction.class.php   
Tue Oct 20 13:29:52 2009        (r3775)
+++ trunk/apps/qubit/modules/informationobject/actions/deleteAction.class.php   
Tue Oct 20 13:47:46 2009        (r3776)
@@ -41,6 +41,8 @@
 
     if ($request->isMethod('delete'))
     {
+      $parentId = $this->informationObject->parentId;
+
       foreach 
($this->informationObject->descendants->andSelf()->orderBy('rgt') as 
$descendant)
       {
         // Delete related digitalObjects
@@ -52,7 +54,14 @@
         $descendant->delete();
       }
 
-      $this->redirect(array('module' => 'informationobject', 'action' => 
'list', 'id' => $this->informationObject->parent->id));
+      if (QubitInformationObject::ROOT_ID != $parentId)
+      {
+        $this->redirect(array('module' => 'informationobject', 'action' => 
'show', 'id' => $parentId));
+      }
+      else
+      {
+        $this->redirect(array('module' => 'informationobject', 'action' => 
'list'));
+      }
     }
   }
 }

--~--~---------~--~----~------------~-------~--~----~
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.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to