When doing a drag and drop from one address book to another, the record value is NULL.  

This may be a problem with my code, what I am doing is fairly simple..  

in my init I do this.

$this->add_hook('contact_create', array($this, 'contact_create'));

in my contact_create function I am doing this...

 

function contact_create($a){
if( is_null($a['record']) ){
                write_log('mylog',$a);
$a['abort'] = true;
return $a;
}
if($a['source'] == $this->abook_id){
$this->put_contact($a);
$a['record']['edit']=$this->results->google_id;
$a['abort'] = false;
}
return $a;
}
 
And the result I see in the log is...
 
[May/23/2011 14:18:10 -0700]: array (
'record' => NULL,
'source' => 'google_contacts',
'group' => NULL,
'abort' => true,
)
 
I am dragging from the personal address book to google_contacts when this happens.   Just creating a contact the normal way works fine, it is just when dragging and dropping.
 
Can anyone tell me what I might be doing wrong?  Or is there a bug in the drag and drop not passing a record to the hook?