Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import validate related contacts in the same way as the main contact #23455

Merged
merged 2 commits into from
May 14, 2022

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Import validate related contacts in the same way as the main contact

This builds on #23424 - extending the required fields to related contact

Before

There is confusing / marginally successful validation code around related contacts - however in my testing there is an uncaught exception in 5.48 when the related contact has insufficient fields (e.g just source) and that is caught at the import stage in current master & logged as an error. In current master the main contact is imported but not the related one

After

The fields for the related contact are checked (& potentially rejected) at the validation stage using the same sub-routine as for the main contact

Technical Details

Comments

@civibot
Copy link

civibot bot commented May 13, 2022

(Standard links)

@totten
Copy link
Member

totten commented May 14, 2022

The new test coverage seems pretty useful.

I did r-run on a few different combinations of (valid,missing-field)x(original-contact,related-contact). Behavior seemed pretty sensible across them. Also ran the scenario from #23424 discussion, and it now produces the same result.

All tests passing.

To refactoring and beyond! 🚀

@totten totten merged commit d04c1b1 into civicrm:master May 14, 2022
@eileenmcnaughton eileenmcnaughton deleted the import_validate_mum branch May 14, 2022 20:53
@eileenmcnaughton
Copy link
Contributor Author

@totten yay - and now you can see how much code can go as a result of this one - #23461

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants