Modified functions in BatchUpdate.php file#139
Open
Edzelopez wants to merge 1 commit into
Open
Conversation
| $unparseableContactAddress[] = " Contact ID: " . $dao->id . " <a href =\"$url\"> " . $dao->street_address . " </a> "; | ||
| // reset element values. | ||
| $parsedFields = array_fill_keys(array_keys($parsedFields), ''); | ||
| /** |
Member
There was a problem hiding this comment.
These lines should be moved to L219 in an else code block. This is because this part of the code is about street addressing parsing not geocoding
| * If an address has failed in the geocoding scheduled job i.e. no lat/long is fetched, we will update the manual_geocode field to 1. | ||
| */ | ||
| $results = \Civi\Api4\Address::update() | ||
| ->addValue('manual_geo_code', true) |
Member
There was a problem hiding this comment.
also this should be changed I think to be like
$addressParams = [
'manual_geo_code' => 1,
'geo_code_1' => 0,
'geo_code_2' => 1,
];| // when we should found street_number and street_name | ||
| if (empty($parsedFields['street_name']) || empty($parsedFields['street_number'])) { | ||
| $success = FALSE; | ||
| // If an address has failed in the geocoding scheduled job i.e. no lat/long is fetched, we will update the manual_geocode field to 1. |
Member
There was a problem hiding this comment.
@maryguo2023 these 4 lines need to be moved in Old line 214
Member
There was a problem hiding this comment.
the code there should be like the following as this section is about address parsing not geocoding of addresses
if (isset($params['geo_code_1']) && $params['geo_code_1'] != 'null') {
$totalGeocoded++;
$addressParams = $params;
}
else {
// If an address has failed in the geocoding scheduled job i.e. no lat/long is fetched, we will update the manual_geocode field to 1.
$addressParams['manual_geo_code'] = TRUE;
$addressParams['geo_code_1'] = 0;
$addressParams['geo_code_2'] = 0;
}f19459f to
bb6526c
Compare
60ca79c to
8ea205e
Compare
8ea205e to
30027f9
Compare
This file contains hidden or 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
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
A brief description of the pull request. Keep technical jargon to a minimum. Hyperlink relevant discussions.
Before
What is the old user-interface or technical-contract (as appropriate)?
For optimal clarity, include a concrete example such as a screenshot, GIF (LICEcap, SilentCast), or code-snippet.
After
What changed? What is new old user-interface or technical-contract?
For optimal clarity, include a concrete example such as a screenshot, GIF (LICEcap, SilentCast), or code-snippet.
Technical Details
If the PR involves technical details/changes/considerations which would not be manifest to a casual developer skimming the above sections, please describe the details here.
Comments
Anything else you would like the reviewer to note