aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/Contact.php3
-rw-r--r--mod/connedit.php11
2 files changed, 11 insertions, 3 deletions
diff --git a/include/Contact.php b/include/Contact.php
index 6b5f9388c..008574d8f 100644
--- a/include/Contact.php
+++ b/include/Contact.php
@@ -174,9 +174,6 @@ function abook_toggle_flag($abook,$flag) {
);
}
- $a = get_app();
- if($a->data['abook'])
- $a->data['abook']['abook_flags'] = $a->data['abook']['abook_flags'] ^ $flag;
return $r;
}
diff --git a/mod/connedit.php b/mod/connedit.php
index 866f83615..75a5fd719 100644
--- a/mod/connedit.php
+++ b/mod/connedit.php
@@ -314,6 +314,17 @@ function connedit_clone(&$a) {
if(! $a->poi)
return;
+
+ $r = q("SELECT abook.*, xchan.*
+ FROM abook left join xchan on abook_xchan = xchan_hash
+ WHERE abook_channel = %d and abook_id = %d LIMIT 1",
+ intval(local_channel()),
+ intval($a->poi['abook_id'])
+ );
+ if($r) {
+ $a->poi = $r[0];
+ }
+
$clone = $a->poi;
unset($clone['abook_id']);