diff --git a/core/contacts/contacts.php b/core/contacts/contacts.php index abdbdbfe2f..5e5722524b 100644 --- a/core/contacts/contacts.php +++ b/core/contacts/contacts.php @@ -245,7 +245,7 @@ //get the list $sql = "select *, "; - $sql .= "(select a.contact_attachment_uuid from v_contact_attachments as a where a.contact_uuid = c.contact_uuid and a.attachment_primary = 1) as contact_attachment_uuid "; + $sql .= "(select a.contact_attachment_uuid from v_contact_attachments as a where a.contact_uuid = c.contact_uuid and a.attachment_primary = 1 limit 1) as contact_attachment_uuid "; $sql .= "from v_contacts as c "; $sql .= "where true "; if ($show != "all" || !permission_exists('contact_all')) {