-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
Export code cleanup: Convert relationships to pseudonames at the point of loading #12586
Export code cleanup: Convert relationships to pseudonames at the point of loading #12586
Conversation
(Standard links)
|
Thanks @jitendrapurohit - once I've sorted out #12579 I'l add a test to capture that & try to fix it |
@eileenmcnaughton Looks like this PR is part of a larger code cleanup, initiated by efforts at fixing CRM-20632, which is an issue we're facing now. Anything I could do to help this along? (I suspect the complexity is such that adding more manpower doesn't help, but just in case ...) |
@eileenmcnaughton time for the next chunk. |
Jenkins test this please. |
@eileenmcnaughton Having trouble following the PRs here; is there another one that's awaiting review on the way to resolving CRM-20623? |
@twomice this probably needs more work on this one - but if you are ready to do some more review I'll revisit it and fix the issue above + add test, or replace this |
@eileenmcnaughton yes I've got time for a review or two. |
ee4b889
to
db365a2
Compare
@twomice @jitendrapurohit I was able to capture the issue as described by @jitendrapurohit in a unit test & address it. I've updated the PR with those fixes - it did grow it a bit but it's definitely moving in the right direction. I have some more fixes locally that build on this that I will do as the next PR |
test this please |
The failing test is the one added in this PR and it fails on my local too. |
bb8b648
to
10eeff1
Compare
The relationship array is being built with 'names' & the main array with 'unique names' which later need to be wrangled back into sync. Do relationships the same as main array
10eeff1
to
cedeaa5
Compare
@jitendrapurohit it seems I added a check to prove 'is_deleted' was merged in the output -but actually it never is because the relationship is skipped if the household is deleted - so I removed that & I think it should pass now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming that the issue mentioned in my above comment is fixed. Also checked the exports related to different components and relationships. They seem to work fine after the change 👍
thanks @jitendrapurohit |
Thanks @jitendrapurohit ! |
Please ping me on subsequent PRs related to this (really, related to CRM-20632); still glad to review as needed. Thanks! |
@twomice can you put those up onto github - perbhaps a WIP PR. I'm really curious as to whether it will look like the changes I was imagining next |
@eileenmcnaughton I don't have any code to offer at this point, was just quoting you where you said "I have some more fixes locally that build on this that I will do as the next PR" in a comment above (#12586 (comment)), and offering to review the next PR(s) if/when you put them up. |
@twomice oh I misread |
I think I'm going to fix up the handling of phonetypes yet - I think you can see if you look at the code now we are almost at the point where we can just array merge in php & not write the household stuff to temp table at all |
Overview
Minor code cleanup
Before
Code messier
After
Code less messy
Technical Details
The convertToPseudoName function is called on each instance of the DAO loaded from the relationship query. It makes sense to do this when it is first loaded rather than to pass it deep into the parent function & then do it.
Note we removed the clone action from the main loop a while back -ie. we iterate through a DAO for main export properties & later for relationship properties. We got no issues from that, which feels it was higher risk than doing the same in the secondary loop.
Comments
Testing should be done in conjunction with #12579 which is more complicated but will require the same sorts of UI tests