fix adding new tasks from activesync messages
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 24 Apr 2010 18:38:46 +0000 (14:38 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 24 Apr 2010 18:38:46 +0000 (14:38 -0400)
$storage->add() returns an array, not the uid.

nag/lib/Api.php

index fef3292..134da4c 100644 (file)
@@ -837,7 +837,7 @@ class Nag_Api extends Horde_Registry_Api
         case 'activesync':
             $task = new Nag_Task();
             $task->fromASTask($content);
-            return $storage->add(
+            $results = $storage->add(
                         isset($task->name) ? $task->name : '',
                         isset($task->desc) ? $task->desc : '',
                         isset($task->start) ? $task->start : 0,
@@ -853,6 +853,9 @@ class Nag_Api extends Horde_Registry_Api
                         !empty($task->private),
                         Horde_Auth::getAuth(),
                         isset($task->assignee) ? $task->assignee : null);
+            
+            /* array index 0 is id, 1 is uid */
+            return $results[1];
         }
 
         return PEAR::raiseError(sprintf(_("Unsupported Content-Type: %s"), $contentType));