From 374b47a776c43afd9bd570b29f9feb120b56e469 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Mon, 1 Apr 2019 21:40:19 +0100 Subject: [PATCH] dev/core/issues/842, Fixed code to update website rather delete --- CRM/Core/BAO/Website.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CRM/Core/BAO/Website.php b/CRM/Core/BAO/Website.php index bc82b73da0..29e118b958 100644 --- a/CRM/Core/BAO/Website.php +++ b/CRM/Core/BAO/Website.php @@ -99,10 +99,15 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website { $ids = self::allWebsites($contactID); foreach ($params as $key => $values) { + $id = CRM_Utils_Array::value('id', $values); + if (array_key_exists($id, $ids)) { + unset($ids[$id]); + } 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; + unset($ids[$id]); } } } -- 2.25.1