-
-
Notifications
You must be signed in to change notification settings - Fork 812
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
Minor refactor preparatory to function extraction #12468
Conversation
(Standard links)
|
CRM/Export/BAO/Export.php
Outdated
@@ -487,7 +487,18 @@ public static function exportComponents( | |||
} | |||
} | |||
else { | |||
$primary = TRUE; | |||
$extraProperties = self::defineExtraProperties($queryMode); |
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.
@eileenmcnaughton not sure why the movement of these 4 lines as they should be done whether we have select fields or not i would have thought, I agree with L495 - L500 tho
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.
@seamuslee001 so moving them doesn't affect whether they are run or not - it just moves them to the outside of a code chunk they don't logically fit in the middle of
2391353
to
26caa4e
Compare
@seamuslee001 I updated this to remove the move of those lines - mostly because I have a new plan for them which means I'll probably address them before rather than after the follow up code extraction -(once #12485 is merged a whole lot of cleanup options open up) |
CRM/Export/BAO/Export.php
Outdated
'im_provider' => 1, | ||
'phone_type_id' => 1, | ||
'current_employer' => 1, | ||
]; |
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.
I'm not sure what provider_id
even is but it's missing from the diff. Was that omission intentional?
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.
ah yeah - it's a pseudonym for im_provider - I'll put it back until we figure out which one we don't need
26caa4e
to
be1b612
Compare
@colemanw updated ^^ |
@monishdeb are you ok to merge this - test fail has a fix in #12490 |
Yes, did a quick check on my local after applying this patch and is safe to merge. |
thanks! |
'phone_type_id' => 1, | ||
'provider_id' => 1, | ||
'current_employer' => 1, | ||
]; | ||
$fields = CRM_Contact_BAO_Contact::exportableFields('All', TRUE, TRUE); | ||
foreach ($fields as $key => $var) { | ||
if ($key && (substr($key, 0, 6) != 'custom')) { |
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.
maybe, move(array_merge) the above initialization after this for loop?
@jitendrapurohit ok I'll wait til other open related PRs are merged & then add a test + follow up on this |
Overview
Minor code simplication preparatory to function extraction
Before
$isPrimary is defined & is always TRUE & then used in an if. Detail relating to extraProperties is half way through the code that makes sense to extract.
After
$isPrimary removed, extraProperties code re-ordered
Technical Details
This is highly toxic code. We have some fixes to do but it needs many incremental cleanups first IMHO
Comments
@jitendrapurohit @monishdeb