From 594833d6c71dedd0e8fadca861581287b0f258db Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Thu, 18 Feb 2016 11:47:51 +0530 Subject: [PATCH] CRM-18039 -- Do not set default for blocks if in update mode --- CRM/Contact/Form/Contact.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index 4bde8dc3b8..e3d03cdbd8 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -510,11 +510,13 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { for ($instance = 1; $instance <= $this->get($blockName . '_Block_Count'); $instance++) { // make we require one primary block, CRM-5505 - if ($updateMode && !$hasPrimary) { - $hasPrimary = CRM_Utils_Array::value( - 'is_primary', - CRM_Utils_Array::value($instance, $defaults[$name]) - ); + if ($updateMode) { + if(!$hasPrimary) { + $hasPrimary = CRM_Utils_Array::value( + 'is_primary', + CRM_Utils_Array::value($instance, $defaults[$name]) + ); + } continue; } -- 2.25.1