dev/core#2039 Remove extraneous location queries from contact.create->Location::block...
authoreileen <emcnaughton@wikimedia.org>
Tue, 6 Oct 2020 23:56:35 +0000 (12:56 +1300)
committereileen <emcnaughton@wikimedia.org>
Tue, 6 Oct 2020 23:56:35 +0000 (12:56 +1300)
commit1a526b681d693e7abe3768ac14dd02c03a37c73b
treef8e8f4ce73af81cb55822117f0ac86f650557c43
parentc235cc1b0962d9140a61da98c9245c8ed8146f06
dev/core#2039 Remove extraneous location queries from contact.create->Location::block path

Overview
----------------------------------------
Removes 10 queries from each contact  create that are otherwise dealt with elsewhere
Updated version of https://github.com/civicrm/civicrm-core/pull/18477

Before
----------------------------------------
After creating location blocks 2 queries are done for each of the 5 entities to ensure is_primary fields have not been messed up (ie contact has 1 or more phones but none are marked primary or contact has more than one primary phone).

After
----------------------------------------
Queries are removed as location entities are already created correctly

Technical Details
----------------------------------------
This PR is part of a series of PRs to make this possible - best documented at https://lab.civicrm.org/dev/core/-/issues/2039#note_47758

Comments
----------------------------------------
https://lab.civicrm.org/dev/core/-/issues/2039
CRM/Core/BAO/Location.php
tests/phpunit/CiviTest/CiviUnitTestCase.php
tests/phpunit/api/v3/JobTest.php
tests/phpunit/api/v3/SyntaxConformanceTest.php