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] minor refactor towards removing complexity. #15594

Merged
merged 3 commits into from
Oct 25, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Oct 24, 2019

Overview

Minor code legibility improvement.

Before

Less readable

After

More readable.
UI still works the same
Screen Shot 2019-10-24 at 3 45 39 PM

Technical Details

This change actually makes the foreach & if following it redundant. I left them out for legibility
but basically all the wrangling is on the 'other' contact. We do just one thing with the 'main'
contact so the whole foreach & if is silly. This is the follow up to #15593 that incorporates removal of the if & foreach

Comments

This change actually makes the foreach & if following it redundant. I left them out for legibility
but basically all the wrangling is on the 'other' contact. We do just one thing with the 'main'
contact so the whole foreach & if is silly. Will follow up with removal of those
@civibot
Copy link

civibot bot commented Oct 24, 2019

(Standard links)

$value[1] = NULL;
}
$rows["move_$field"]['main'] = self::getFieldValueAndLabel($field, $main)['label'];
$rows["move_$field"]['other'] = self::getFieldValueAndLabel($field, $other)['label'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function getFieldValueAndLabel does not appear to return an indexed array, so I don't think you can access ['label'] from its return values.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nevermind I see you changed that in this pr.

@eileenmcnaughton
Copy link
Contributor Author

test this please

@mattwire
Copy link
Contributor

Ok, @colemanw has looked at this and I'm happy with the code changes. Having the 3 commits is useful for clarity and ease of review of the changes - I don't think we need a separate PR though #15593

@mattwire mattwire merged commit 55af4b2 into civicrm:master Oct 25, 2019
@eileenmcnaughton eileenmcnaughton deleted the dedupe2 branch October 25, 2019 20:27
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.

3 participants