]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fixed showing first contact if non is selected.
authorThomas Tanghus <thomas@tanghus.net>
Mon, 2 Jan 2012 22:14:58 +0000 (23:14 +0100)
committerThomas Tanghus <thomas@tanghus.net>
Mon, 9 Jan 2012 19:38:05 +0000 (20:38 +0100)
apps/contacts/index.php

index b392b195a9cc6793ae54aecbe23b642a1d2e1434..b7c88236a801667f51a96fe2c44f09b5fdb9abec 100644 (file)
@@ -45,11 +45,17 @@ $id = isset( $_GET['id'] ) ? $_GET['id'] : null;
 $details = array();
 
 // FIXME: This cannot work..?
-if( !is_null($id)/* || count($contacts)*/){
-       if(is_null($id)) $id = $contacts[0]['id'];
-       $vcard = OC_Contacts_App::getContactVCard($id);
-       $details = OC_Contacts_VCard::structureContact($vcard);
+if(is_null($id) && count($contacts) > 0) {
+       $id = $contacts[0]['id'];
 }
+$vcard = OC_Contacts_App::getContactVCard($id);
+$details = OC_Contacts_VCard::structureContact($vcard);
+
+// if( !is_null($id)/* || count($contacts)*/){
+//     if(is_null($id)) $id = $contacts[0]['id'];
+//     $vcard = OC_Contacts_App::getContactVCard($id);
+//     $details = OC_Contacts_VCard::structureContact($vcard);
+// }
 
 // Include Style and Script
 OC_Util::addScript('contacts','interface');