* addressbook: fix for attempt to remove non existing link; happens when addressbook read returns nothing, that may be caused by trying to merge an addressbook-entry with nonexisting customfields array

This commit is contained in:
Klaus Leithoff 2011-01-06 14:13:52 +00:00
parent 3c469c8392
commit 6549d3e463
2 changed files with 2 additions and 2 deletions

View File

@ -577,7 +577,7 @@ class addressbook_sql extends so_sql_cf
// Change autoinc_id to match $this->db_cols
$this->autoinc_id = $this->db_cols[$this->autoinc_id];
if(($id = (int)$this->data[$this->autoinc_id]) && $cfs = $this->read_customfields($keys)) {
$contact = array_merge($contact,$cfs[$id]);
if (is_array($cfs[$id])) $contact = array_merge($contact,$cfs[$id]);
}
$this->autoinc_id = array_search($this->autoinc_id, $this->db_cols);

View File

@ -1449,7 +1449,7 @@ class addressbook_ui extends addressbook_bo
}
else
{
$content['link_to']['to_id'] = $contact_id;
if (is_int($contact_id)) $content['link_to']['to_id'] = $contact_id;
}
// automatic link new entries to entries specified in the url
if (!$contact_id && isset($_REQUEST['link_app']) && isset($_REQUEST['link_id']) && !is_array($content['link_to']['to_id']))