From 9106c7fbfef0b91c5d52d09d6dd002ccaeb7ed48 Mon Sep 17 00:00:00 2001 From: fusionate Date: Tue, 28 Jan 2025 16:11:21 -0700 Subject: [PATCH] Contact - Phone: Adjust to even check same contact for duplicate speed dial numbers. --- core/contacts/contact_phone_edit.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/contacts/contact_phone_edit.php b/core/contacts/contact_phone_edit.php index acb196b05f..f204491500 100644 --- a/core/contacts/contact_phone_edit.php +++ b/core/contacts/contact_phone_edit.php @@ -163,9 +163,9 @@ $sql .= "from v_contact_phones "; $sql .= "where phone_speed_dial = :phone_speed_dial "; $sql .= "and domain_uuid = :domain_uuid "; - if ($action == "update") { - $sql .= "and contact_uuid <> :contact_uuid "; - $parameters['contact_uuid'] = $contact_uuid; + if ($action == "update" && is_uuid($contact_phone_uuid)) { + $sql .= "and contact_phone_uuid <> :contact_phone_uuid "; + $parameters['contact_phone_uuid'] = $contact_phone_uuid; } $parameters['phone_speed_dial'] = $phone_speed_dial; $parameters['domain_uuid'] = $domain_uuid;