From 3d03e8fb015e65dae9a6ce88270f1f0fb9040008 Mon Sep 17 00:00:00 2001 From: Klaas Eikelboom Date: Tue, 19 Nov 2019 15:54:07 +0100 Subject: [PATCH] Fix for lab issue 1365 - the unset code did not realy clear the id, because it was handed an array instead of a single value. The effect was that only the first value was updated --- CRM/Member/BAO/Membership.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index 32dec62e80..d70950ef2f 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -1407,8 +1407,10 @@ WHERE civicrm_membership.contact_id = civicrm_contact.id unset($params['reminder_date']); // unset the custom value ids if (is_array(CRM_Utils_Array::value('custom', $params))) { - foreach ($params['custom'] as $k => $v) { - unset($params['custom'][$k]['id']); + foreach ($params['custom'] as $k => $values) { + foreach ($values as $i => $value) { + unset($params['custom'][$k][$i]['id']); + } } } if (!isset($params['membership_type_id'])) { -- 2.25.1