Handle error when creating related contact
authorEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 2 Jun 2022 01:37:20 +0000 (13:37 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 2 Jun 2022 06:55:00 +0000 (18:55 +1200)
commit1149a00c8ac08dfd4aba47c7b34e1e22596038b9
treef5c8d6f3f86c54bedbe094de613d0e918b2b0cdc
parentd7a0cf7cc7b16fd788682dbb7f24f74fe33ef18c
Handle error when creating related contact

This addresses the e-notice identified here
https://github.com/civicrm/civicrm-core/pull/23643#discussion_r887406505

I believe the bug report in that thread was a variant of the e-notice. Ie the import()
function was failing to catch an exception & it was bubbling up to run()

While there is no support currently for calling import()
outside of run() - the intent is to replace run() with something
more sane - which WILL be callable from the outside (likely
via api).

The right behaviour for import() is to catch all errors
CRM/Contact/BAO/Contact.php
CRM/Contact/Import/Parser/Contact.php
tests/phpunit/CRM/Contact/Import/Parser/ContactTest.php