CRM-18039 -- Do not set default for blocks if in update mode
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 18 Feb 2016 06:17:51 +0000 (11:47 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 18 Feb 2016 06:17:51 +0000 (11:47 +0530)
CRM/Contact/Form/Contact.php

index 4bde8dc3b8b0610488ef79c519a8b75afaa81602..e3d03cdbd8c16dbe11285af0a82e749e9b71ecd4 100644 (file)
@@ -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;
         }