I'm trying to add a sub-panel (for notes) to the Task module. Since there are no current sub-panels in the task module, I have done the following:

1) added the necessary code to display sub-panels on /modules/tasks/detailview html and php files
2) created a layout_def.php file in /modules/tasks (that file didn't exist)
3) added the necessary code to vardefs.php in /modules/tasks:

//notes to tasks
'notes' =>array (
'name' => 'notes',
'type' => 'link',
'relationship' => 'task_notes',
'module' => 'Notes',
'source'=> 'non-db',
'ignore_role' =>true,
'vname'=> 'LBL_Notes',
),
//end notes to tasks

//new code
,'task_notes' => array('lhs_module'=> 'Tasks', 'lhs_table'=> 'tasks', 'lhs_key' => 'id',
'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'parent_id',
'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
'relationship_role_column_value'=>'Tasks')
//end new code

4) rebuilt the relationships

I get the following error:
Call to a member function getQuery() on a non-object in C:\Program Files\SugarCRM\oss\httpd\htdocs\Sugar_Prod\data\Su garBean.php on line 1464

I think I know why, but not sure what to do next. Do I need to create a meta file in /metaData (and add the info to tabledefinitions.php) and also put the relationship info in there? I looked at some other meta files but I wasn't able to figure it out.