From 4915610b5fafd59f95204af03eb2e283d5867390 Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Thu, 11 Aug 2011 11:20:12 +0200 Subject: [PATCH] Fix creation of UID in contacts --- apps/contacts/lib/addressbook.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/contacts/lib/addressbook.php b/apps/contacts/lib/addressbook.php index bab260840d..9a5dea6f45 100644 --- a/apps/contacts/lib/addressbook.php +++ b/apps/contacts/lib/addressbook.php @@ -167,7 +167,12 @@ class OC_Contacts_Addressbook{ $uri = $property->value.'.vcf'; } } - if(is_null($uri)) $uri = self::createUID().'.vcf'; + if(is_null($uri)){ + $uid = self::createUID(); + $uri = $uid.'.vcf'; + $card->add(new Sabre_VObject_Property('UID',$uid)); + $data = $card->serialize(); + }; $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_cards (addressbookid,fullname,carddata,uri,lastmodified) VALUES(?,?,?,?,?)' ); $result = $stmt->execute(array($id,$fn,$data,$uri,time()));