]> source.dussan.org Git - nextcloud-server.git/commitdiff
OC_DB::insertid was being called too late to get the correct result.
authorThomas Tanghus <thomas@tanghus.net>
Mon, 9 Jan 2012 22:14:11 +0000 (23:14 +0100)
committerThomas Tanghus <thomas@tanghus.net>
Mon, 9 Jan 2012 22:14:11 +0000 (23:14 +0100)
apps/contacts/lib/vcard.php

index beb291b481e0d3661adb4ebb85434f6380f1d761..6a248ff59e4eac7e9cf30b9f4e1185b294efb354 100644 (file)
@@ -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;
        }
 
        /**