From: colemanw Date: Wed, 7 Oct 2020 13:47:34 +0000 (-0400) Subject: Merge pull request #18663 from eileenmcnaughton/blockdel3 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6d9ced7dbb35f84ec7b022111bab55044e4ef5fa;p=civicrm-core.git Merge pull request #18663 from eileenmcnaughton/blockdel3 dev/core#2039 Remove extraneous location queries from contact.create->Location::block path --- 6d9ced7dbb35f84ec7b022111bab55044e4ef5fa diff --cc CRM/Core/BAO/Block.php index 18725f489b,5b7587e865..dde0c3fae2 --- a/CRM/Core/BAO/Block.php +++ b/CRM/Core/BAO/Block.php @@@ -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;