From bc54f136364b20a0ea8cb1ed95802646daa2f81e Mon Sep 17 00:00:00 2001
From: Bart Visscher <bartv@thisnet.nl>
Date: Fri, 7 Oct 2011 21:59:18 +0200
Subject: [PATCH] Fix name when adding contact

---
 apps/contacts/ajax/addcard.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/apps/contacts/ajax/addcard.php b/apps/contacts/ajax/addcard.php
index ee95513732..70e0f0a89d 100644
--- a/apps/contacts/ajax/addcard.php
+++ b/apps/contacts/ajax/addcard.php
@@ -44,9 +44,10 @@ $vcard->add(new Sabre_VObject_Property('UID',OC_Contacts_VCard::createUID()));
 $id = OC_Contacts_VCard::add($aid,$vcard->serialize());
 
 $details = OC_Contacts_VCard::structureContact($vcard);
+$name = $details['FN'][0]['value'];
 $tmpl = new OC_Template('contacts','part.details');
 $tmpl->assign('details',$details);
 $tmpl->assign('id',$id);
 $page = $tmpl->fetchPage();
 
-OC_JSON::success(array('data' => array( 'id' => $id, 'page' => $page )));
+OC_JSON::success(array('data' => array( 'id' => $id, 'name' => $name, 'page' => $page )));
-- 
GitLab