diff options
Diffstat (limited to 'apps/contacts/lib')
-rw-r--r-- | apps/contacts/lib/vcard.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php index b213bcd7623..91ac89f5535 100644 --- a/apps/contacts/lib/vcard.php +++ b/apps/contacts/lib/vcard.php @@ -589,7 +589,7 @@ class OC_Contacts_VCard{ * @return boolean * */ - public static function moveToAddressBook($aid, $id) { + public static function moveToAddressBook($aid, $id, $isAddressbook = false) { OC_Contacts_App::getAddressbook($aid); // check for user ownership. if(is_array($id)) { $id_sql = join(',', array_fill(0, count($id), '?')); @@ -606,8 +606,13 @@ class OC_Contacts_VCard{ return false; } } else { - try { + $stmt = null; + if($isAddressbook) { + $stmt = OCP\DB::prepare( 'UPDATE *PREFIX*contacts_cards SET addressbookid = ? WHERE addressbookid = ?' ); + } else { $stmt = OCP\DB::prepare( 'UPDATE *PREFIX*contacts_cards SET addressbookid = ? WHERE id = ?' ); + } + try { $result = $stmt->execute(array($aid, $id)); } catch(Exception $e) { OCP\Util::writeLog('contacts', __CLASS__.'::'.__METHOD__.', exception: '.$e->getMessage(), OCP\Util::DEBUG); |