From 6e88659b695c6c48de60935fd73e6868b65cdf50 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Mon, 9 Jan 2012 23:14:11 +0100 Subject: [PATCH] OC_DB::insertid was being called too late to get the correct result. --- lib/vcard.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vcard.php b/lib/vcard.php index beb291b4..6a248ff5 100644 --- a/lib/vcard.php +++ b/lib/vcard.php @@ -130,10 +130,11 @@ class OC_Contacts_VCard{ $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_cards (addressbookid,fullname,carddata,uri,lastmodified) VALUES(?,?,?,?,?)' ); $result = $stmt->execute(array($id,$fn,$data,$uri,time())); + $newid = OC_DB::insertid('*PREFIX*contacts_cards'); OC_Contacts_Addressbook::touch($id); - return OC_DB::insertid('*PREFIX*contacts_cards'); + return $newid; } /**