From: jitendrapurohit Date: Thu, 18 Feb 2016 06:17:51 +0000 (+0530) Subject: CRM-18039 -- Do not set default for blocks if in update mode X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=594833d6c71dedd0e8fadca861581287b0f258db;p=civicrm-core.git CRM-18039 -- Do not set default for blocks if in update mode --- 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; }