Contacts - List: Only retrieve a single Primary attachment, in the chance that multiple exist.

This commit is contained in:
fusionate
2025-02-28 11:03:05 -07:00
parent 3de202b987
commit f6df4fd0b3

View File

@@ -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')) {