-
-
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 minor refactor Move household relationship types to the processor #12579
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Standard links)
|
eileenmcnaughton
force-pushed
the
export_another
branch
2 times, most recently
from
July 28, 2018 04:12
7387f54
to
47df9ca
Compare
eileenmcnaughton
force-pushed
the
export_another
branch
2 times, most recently
from
July 30, 2018 20:19
e649b34
to
ae442bb
Compare
eileenmcnaughton
force-pushed
the
export_another
branch
from
August 1, 2018 04:37
ae442bb
to
38697ca
Compare
test this please |
eileenmcnaughton
force-pushed
the
export_another
branch
from
August 4, 2018 03:34
38697ca
to
439355f
Compare
@@ -1214,9 +1189,6 @@ public static function mergeSameHousehold($exportTempTable, &$headerRows, &$sqlC | |||
foreach ($replaced as $from => $to) { | |||
$clause[] = "$from = $to "; | |||
unset($sqlColumns[$to]); | |||
if ($key = CRM_Utils_Array::key($to, $allKeys)) { | |||
unset($headerRows[$key]); |
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.
Not needed as we don't set it in https://github.com/civicrm/civicrm-core/pull/12579/files#diff-2e1de3666cf0b15e640b507b1ab5941fR1416
Makes sense; tests pass. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Code clean up on export : move static variables to the new OO processor class
Before
Code less maintainable
Uses
After
Code more maintainable. Uses
Technical Details
This change is comprehensively covered by this test https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/CRM/Export/BAO/ExportTest.php#L421
@monishdeb when I went to enable the test I found it was a bit broken in the scenario covered by the test. I don't know how realistic is is but the test was requesting a household merge and additionally for household related fields to be returned. The code was deliberately unsetting the headers & sql columns inconsistently here. I updated so that the headers would never be set for household relationship types when merge to household is configured. This is a code simplification & consistent with what the code was trying to do. However, it's not 100% what the user would expect. I think this is a forwards rather than backwards step though.
Comments
Part of larger cleanup - current WIP is #12575