<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="http://bugs.horde.org/themes/feed-rss.xsl" type="text/xsl"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
 <channel>
  <title>Unable to delete tasks (Nag H3 (2.2-cvs))</title>
  <pubDate>Sun, 07 Sep 2008 16:48:07 -0400</pubDate>
  <link>http://bugs.horde.org/ticket/5472</link>
  <atom:link rel="self" type="application/rss+xml" title="Unable to delete tasks (Nag H3 (2.2-cvs))" href="http://bugs.horde.org/ticket/5472/rss" />
  <description>Unable to delete tasks (Nag H3 (2.2-cvs))</description>

  
  
  <item>
   <title>When I try to delete a task I get the error:

Fatal error:</title>
   <description>When I try to delete a task I get the error:

Fatal error: Cannot use object of type PEAR_Error as array in /usr/share/colab/horde/nag/task.php on line 21

It seems that the $tasklist_id argument passed to _delete() is NULL (which comes from the $vars-&gt;get('old_tasklist')) when it should be set to my userid and makes the Nag::GetTask() to fail.

I have managed to isolate it to line 63 in /horde/nag/lib/Forms/task.php:

            count($tasklists) &gt; 1) { 

which I basically interpret as &quot;only do this if there are more than one tasklists&quot;.
However, it seems to be necessary to do $vars-&gt;set('old_tasklist'); even with only one tasklist, so changing it to 

            count($tasklists) &gt; 0) { 

solved the problem. (As would deleting that condition alltogether I suppose.)

My personal reflection would be that the idea was to only use old_tasklist if there is a chance of confusing which tasklist owned the task (i.e. when having multiple tasklists), but it is however used &quot;blindly&quot; in the _delete() function in horde/nag/task.php.

So when this is done with a user with multiple tasklists, no error is ever encountered.</description>
   <pubDate>Mon, 18 Jun 2007 06:13:11 -0400</pubDate>
   <link>http://bugs.horde.org/ticket/5472#t34349</link>
  </item>
  <item>
   <title>Fixed in CVS. Thanks for the detail about having only one ta</title>
   <description>Fixed in CVS. Thanks for the detail about having only one tasklist.</description>
   <pubDate>Mon, 18 Jun 2007 11:56:02 -0400</pubDate>
   <link>http://bugs.horde.org/ticket/5472#t34357</link>
  </item>
  

 </channel>
</rss>
