* Admin: custom-fields were not loaded, account was edited from admin not addressbook

This commit is contained in:
Ralf Becker 2014-07-08 15:05:20 +00:00
parent 017ffe5e15
commit 2de7931700
2 changed files with 2 additions and 9 deletions

View File

@ -742,13 +742,6 @@ class addressbook_sql extends so_sql_cf
}
$contact = parent::read($keys,$extra_cols,$join);
// 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)) {
if (is_array($cfs[$id])) $contact = array_merge($contact,$cfs[$id]);
}
$this->autoinc_id = array_search($this->autoinc_id, $this->db_cols);
// enforce a minium uid strength
if (is_array($contact) && (!isset($contact['uid'])
|| strlen($contact['uid']) < $minimum_uid_length)) {

View File

@ -283,7 +283,7 @@ class so_sql_cf extends so_sql
{
return false;
}
if (($id = (int)$this->data[$this->autoinc_id]) && $this->customfields &&
if (($id = (int)$this->data[$this->db_key_cols[$this->autoinc_id]]) && $this->customfields &&
($cfs = $this->read_customfields($id)))
{
$this->data = array_merge($this->data,$cfs[$id]);
@ -378,7 +378,7 @@ class so_sql_cf extends so_sql
$id2keys = array();
foreach($rows as $key => $row)
{
$id2keys[$row[$this->autoinc_id]] = $key;
$id2keys[$row[$this->db_key_cols[$this->autoinc_id]]] = $key;
}
// check if only certain cf's to show
if (!in_array('customfields', $selectcols))