From f6df4fd0b3c4d85bde70189bd408e7a34009f0a9 Mon Sep 17 00:00:00 2001 From: fusionate Date: Fri, 28 Feb 2025 11:03:05 -0700 Subject: [PATCH] Contacts - List: Only retrieve a single Primary attachment, in the chance that multiple exist. --- core/contacts/contacts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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')) {