Merge pull request #18663 from eileenmcnaughton/blockdel3
authorcolemanw <coleman@civicrm.org>
Wed, 7 Oct 2020 13:47:34 +0000 (09:47 -0400)
committerGitHub <noreply@github.com>
Wed, 7 Oct 2020 13:47:34 +0000 (09:47 -0400)
dev/core#2039 Remove extraneous location queries from contact.create->Location::block path

1  2 
CRM/Core/BAO/Block.php
CRM/Core/BAO/Location.php

index 18725f489be6322b5352b114578b925f3fe82c0f,5b7587e8655ed690e890b4332c37805aa498c0e4..dde0c3fae211018b281fea6e31518c11628f19e2
@@@ -225,31 -225,8 +225,8 @@@ class CRM_Core_BAO_Block 
            unset($value['id']);
          }
        }
-       //lets allow to update primary w/ more cleanly.
-       if (!$resetPrimaryId && !empty($value['is_primary'])) {
-         $primaryId = TRUE;
-         if (is_array($blockIds)) {
-           foreach ($blockIds as $blockId => $blockValue) {
-             if (!empty($blockValue['is_primary'])) {
-               $resetPrimaryId = $blockId;
-               break;
-             }
-           }
-         }
-         if ($resetPrimaryId) {
-           $baoString = 'CRM_Core_BAO_' . $blockName;
-           $block = new $baoString();
-           $block->selectAdd();
-           $block->selectAdd("id, is_primary");
-           $block->id = $resetPrimaryId;
-           if ($block->find(TRUE)) {
-             $block->is_primary = FALSE;
-             $block->save();
-           }
-         }
-       }
      }
 -
 +    $baoString = 'CRM_Core_BAO_' . $name;
      foreach ($params[$blockName] as $count => $value) {
        if (!is_array($value)) {
          continue;
Simple merge