Adamw has uploaded a new change for review.
https://gerrit.wikimedia.org/r/59758
Change subject: only append zip+4 if it exists
......................................................................
only append zip+4 if it exists
Change-Id: I64da22dba740c8a951f187e51b1f9910b8fc08b0
---
M sites/all/modules/offline2civicrm/import_checks.drush.inc
1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm
refs/changes/58/59758/1
diff --git a/sites/all/modules/offline2civicrm/import_checks.drush.inc
b/sites/all/modules/offline2civicrm/import_checks.drush.inc
index 4fe2192..03823b4 100644
--- a/sites/all/modules/offline2civicrm/import_checks.drush.inc
+++ b/sites/all/modules/offline2civicrm/import_checks.drush.inc
@@ -128,7 +128,10 @@
if ( $msg['country'] === "US" ) {
// left-pad the zipcode
if ( preg_match( '/^(\d{1,4})(-\d+)?$/',
$msg['postal_code'], $matches ) ) {
- $msg['postal_code'] = str_pad(
$matches[1], 5, "0", STR_PAD_LEFT ) . $matches[2];
+ $msg['postal_code'] = str_pad(
$matches[1], 5, "0", STR_PAD_LEFT );
+ if ( !empty( $matches[2] ) ) {
+ $msg['postal_code'] .=
$matches[2];
+ }
}
}
--
To view, visit https://gerrit.wikimedia.org/r/59758
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I64da22dba740c8a951f187e51b1f9910b8fc08b0
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Adamw <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits