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

[REF] Duplicate possibly-used parts of createProfileContact onto Parser_Contact #19098

Merged
merged 1 commit into from
Dec 4, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Dec 3, 2020

Overview

[REF] Duplicate possibly-used parts of createProfileContact onto Parser_Contact

Before

Lots of work done to call toxic function - very opaque

After

Possibly salient parts duplicated, facilitating more cleanup

Technical Details

The parser_Contact class should call the api. Getting to that point is
complicated because

  1. it's such a mess and
  2. it does a lot of work to prepare to call createProfileContact
    and it's hard to unravel that.

By copying most of createProfileContact onto the class we can start to
unravel it & pare down to calling the api (note we went through
this process in the dedupe class, at least in part).

I'm pretty sure the hooks reflect 'the way the code grew up' rather than
any logical use/ requirement for the profile hook

Comments

@civibot
Copy link

civibot bot commented Dec 3, 2020

(Standard links)

@seamuslee001
Copy link
Contributor

This looks fine to me and we should have plenty of test coverage here

@eileenmcnaughton eileenmcnaughton changed the title [REF] Duplicate possibly-used parts of createProfileContact onto Pars… [REF] Duplicate possibly-used parts of createProfileContact onto Parser_Contact Dec 3, 2020
@seamuslee001
Copy link
Contributor

Test fails look related @eileenmcnaughton

…er_Contact

The parser_Contact class should call the api. Getting to that point is
complicated because
1) it's such a mess and
2) it does a lot of work to prepare to call createProfileContact
and it's hard to unravel that.

By copying most of createProfileContact onto the class we can start to
unravel it & pare down to calling the api (note we went through
this process in the dedupe class, at least in part).

I'm pretty sure the hooks reflect 'the way the code grew up' rather than
any logical use/ requirement for the profile hook
@eileenmcnaughton
Copy link
Contributor Author

That test is pretty nice actually. I think I've fixed it now

@seamuslee001 seamuslee001 merged commit 134b69e into civicrm:master Dec 4, 2020
@seamuslee001 seamuslee001 deleted the import branch December 4, 2020 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants