From d9ad02fd24f731db8c7372355a103212e77768c5 Mon Sep 17 00:00:00 2001 From: francescbassas Date: Mon, 2 Oct 2023 10:40:38 +0200 Subject: [PATCH] [REF][PHP8.1] Fix deprecation notice on passing NULL as the 3rd param to str_replace for Google geocoding --- CRM/Utils/Geocode/Google.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Utils/Geocode/Google.php b/CRM/Utils/Geocode/Google.php index 247a541096..abab6b313a 100644 --- a/CRM/Utils/Geocode/Google.php +++ b/CRM/Utils/Geocode/Google.php @@ -66,7 +66,7 @@ class CRM_Utils_Geocode_Google { if (!empty($values['state_province']) || (!empty($values['state_province_id']) && $values['state_province_id'] != 'null')) { if (!empty($values['state_province_id'])) { - $stateProvince = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_StateProvince', $values['state_province_id']); + $stateProvince = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_StateProvince', $values['state_province_id']) ?? ''; } else { if (!$stateName) { @@ -74,10 +74,10 @@ class CRM_Utils_Geocode_Google { $values['state_province'], 'name', 'abbreviation' - ); + ) ?? ''; } else { - $stateProvince = $values['state_province']; + $stateProvince = $values['state_province'] ?? ''; } } -- 2.25.1