dev/core#2046 Fix blockDelete to delete while ensuring is_primary is valid
authoreileen <emcnaughton@wikimedia.org>
Fri, 2 Oct 2020 01:32:56 +0000 (14:32 +1300)
committereileen <emcnaughton@wikimedia.org>
Fri, 2 Oct 2020 01:32:56 +0000 (14:32 +1300)
commit5e559a23afa0e5b9bcb6ae6bf9fd47d2b8c07039
treeecc75040f40029bfc7447178b2edddf947a40c03
parente2c512f771c0fd5a4364e4dac4c781e76d15828c
dev/core#2046 Fix blockDelete to delete while ensuring is_primary is valid

The del function on each of the location DAO ensures that after a delete at least one phone (etc) is
marked is_primary. This blockDelete does not do that & per the test it's possible to call this
in such a way that no addresses are primary. Whether this actually happens is a bit unknown.

However, this cleans up block delete in a way where we can demonstrate the tests work
CRM/Core/BAO/Block.php
tests/phpunit/CRM/Contact/Import/Parser/ContactTest.php