6.0.0-beta1
11/9/25

[#5480] Parent lost when completing via checkbox image
Summary Parent lost when completing via checkbox image
Queue Nag
Queue Version HEAD
Type Bug
State No Feedback
Priority 1. Low
Owners jan (at) horde (dot) org
Requester kaosbunny (at) gmail (dot) com
Created 06/19/2007 (6718 days ago)
Due
Updated 07/26/2007 (6681 days ago)
Assigned 07/13/2007 (6694 days ago)
Resolved 07/26/2007 (6681 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
07/26/2007 03:50:57 PM Jan Schneider State ⇒ No Feedback
 
07/13/2007 02:06:44 PM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
How exactly do you complete the task, from the task view, from the 
task list, or from task form? And does it happen in all cases?

Also, what exactly do you mean with "gets lost"? What are the symptoms 
you see?
06/20/2007 02:07:05 AM Chuck Hagenbuch State ⇒ Assigned
Assigned to Jan Schneider
 
06/19/2007 09:48:13 PM kaosbunny (at) gmail (dot) com Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Parent lost when completing via checkbox image
Queue ⇒ Nag
State ⇒ Unconfirmed
Reply to this comment
When completing a task with a parent_task the parent gets lost when 
the task completion is updated.



From what I could see, this stems from some confusion between 
$task->parent and $task->parent_id when loading/saving/merging the task.



The problem is probably in Nag_Driver_sql::_buildTree() but can also 
be seen in Nag_Task::merge() in the lines 562-565:



              } elseif ($key == 'parent') {

                 $key = 'parent_id';

             }

             $this->$key = $val;



parent contains the data from parent_task, but the substitution above 
becomes a problem, since both parent and parent_id are already present 
in the task being merged, which results in it being overwritten when 
the $key is actually 'parent_id' (which comes after $key == 'parent') 
in the order of the properties.



I felt that tasks being passed around like this requires a more solid 
understanding of the framework, so I haven't studied it much further 
than this.

Saved Queries