From a145288c97eacbb1853939fb4d02b99ed72cdfbb Mon Sep 17 00:00:00 2001 From: Andrew Hunt Date: Mon, 5 Feb 2018 21:00:08 -0500 Subject: [PATCH] Revert "CRM-21575 - Websites of same type are over-written" This reverts commit dddcec4545602395fc865273175eb7227947cf74. --- CRM/Core/BAO/Website.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CRM/Core/BAO/Website.php b/CRM/Core/BAO/Website.php index 3094bf73cc..96f91873d9 100644 --- a/CRM/Core/BAO/Website.php +++ b/CRM/Core/BAO/Website.php @@ -73,7 +73,15 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website { return FALSE; } + $ids = self::allWebsites($contactID); foreach ($params as $key => $values) { + if (empty($values['id']) && is_array($ids) && !empty($ids)) { + foreach ($ids as $id => $value) { + if (($value['website_type_id'] == $values['website_type_id'])) { + $values['id'] = $id; + } + } + } if (!empty($values['url'])) { $values['contact_id'] = $contactID; self::add($values); -- 2.25.1