Revert "Need to consistently key events by string, not by integer, otherwise"
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 12 Nov 2009 20:52:54 +0000 (15:52 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 12 Nov 2009 20:52:54 +0000 (15:52 -0500)
This won't work, as we won't have any way to retrieve the event now. *sigh*

This reverts commit c30b152c027c0b0727f8a7f43b5d1a2490653e21.

kronolith/lib/Driver/Ical.php

index 0719df3..9f8440b 100644 (file)
@@ -79,14 +79,16 @@ class Kronolith_Driver_Ical extends Kronolith_Driver
 
         $components = $iCal->getComponents();
         $events = array();
+        $count = count($components);
         $exceptions = array();
-        foreach ($components as $component) {
+        for ($i = 0; $i < $count; $i++) {
+            $component = $components[$i];
             if ($component->getType() == 'vEvent') {
                 $event = new Kronolith_Event_Ical($this);
                 $event->status = Kronolith::STATUS_FREE;
                 $event->fromiCalendar($component);
                 $event->remoteCal = $this->_calendar;
-                $event->eventID = hash('md5', uniqid(mt_rand(), true));
+                $event->eventID = $i;
 
                 /* Catch RECURRENCE-ID attributes which mark single recurrence
                  * instances. */