Author: david
Date: Wed Nov 10 13:37:21 2010
New Revision: 8817

Log:
Rollback r8816 - change is *not* functionaly equivalent.

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

Modified: 
trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/editAction.class.php     
Wed Nov 10 12:44:00 2010        (r8816)
+++ trunk/apps/qubit/modules/informationobject/actions/editAction.class.php     
Wed Nov 10 13:37:21 2010        (r8817)
@@ -570,8 +570,18 @@
       // Update pub status of descendants
       foreach ($this->resource->descendants as $descendant)
       {
-        $descendant->setStatus(array('typeId' => 
QubitTerm::STATUS_TYPE_PUBLICATION_ID, 'statusId' => $pubStatusId));
-        $descendant->save();
+        if (null === $descendantPubStatus = 
$descendant->getStatus(array('typeId' => 
QubitTerm::STATUS_TYPE_PUBLICATION_ID)))
+        {
+          $descendantPubStatus = new QubitStatus;
+          $descendantPubStatus->typeId = QubitTerm::STATUS_TYPE_PUBLICATION_ID;
+          $descendantPubStatus->objectId = $descendant->id;
+        }
+
+        if ($pubStatusId != $descendantPubStatus->statusId)
+        {
+          $descendantPubStatus->statusId = $pubStatusId;
+          $descendantPubStatus->save();
+        }
       }
     }
   }

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