Author: sevein
Date: Wed Aug  1 12:45:31 2012
New Revision: 12025

Log:
Stop trying to link new dates to an existing creator when setDates() is used. 
This is not really necessary and seems to fix issue 2385. Thanks to Tim 
Hutchnson and Simon Sheppard for the research, much appreciated.

Modified:
   trunk/lib/model/QubitInformationObject.php

Modified: trunk/lib/model/QubitInformationObject.php
==============================================================================
--- trunk/lib/model/QubitInformationObject.php  Wed Aug  1 07:48:20 2012        
(r12024)
+++ trunk/lib/model/QubitInformationObject.php  Wed Aug  1 12:45:31 2012        
(r12025)
@@ -1386,30 +1386,15 @@
       $eventTypeId = QubitTerm::CREATION_ID;
     }
 
-    // assign the dates to the same event as the creator for this information 
object
-    // if there is more than one creator, assign it to the first one that is 
returned
-    if (count($creationEvents = $this->getCreationEvents()) > 0)
-    {
-      $event = $creationEvents[0];
-      $event->setIndexOnSave(false);
-      $event->setStartDate($normalizedDate['start']);
-      $event->setEndDate($normalizedDate['end']);
-      $event->setTypeId($eventTypeId);
-      $event->setDate($date);
-      $event->save();
-    }
-    else
-    {
-      // if this information object is not linked to a creator, create an 
event object
-      // and link it to the information object
-      $event = new QubitEvent;
-      $event->setTypeId($eventTypeId);
-      $event->setStartDate($normalizedDate['start']);
-      $event->setEndDate($normalizedDate['end']);
-      $event->setDate($date);
+    // if this information object is not linked to a creator, create an event 
object
+    // and link it to the information object
+    $event = new QubitEvent;
+    $event->setTypeId($eventTypeId);
+    $event->setStartDate($normalizedDate['start']);
+    $event->setEndDate($normalizedDate['end']);
+    $event->setDate($date);
 
-      $this->events[] = $event;
-    }
+    $this->events[] = $event;
   }
 
   protected function getDefaultDateValue($date)

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