diff --git a/CHANGELOG.MD b/CHANGELOG.MD index bdfdd30a..c36fea2d 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] -TMS-942: +- TMS-942: - Check / uncheck search filter checkboxes depending on choices - Trim contact phone number in href - Increase fly-out-nav z-index to prevent chatbot from overlapping elements diff --git a/lib/Formatters/ContactFormatter.php b/lib/Formatters/ContactFormatter.php index c214904d..5f6dc8c5 100644 --- a/lib/Formatters/ContactFormatter.php +++ b/lib/Formatters/ContactFormatter.php @@ -143,9 +143,9 @@ public function map_keys( array $posts, array $field_keys, $default_image = null } ); // Remove whitespaces from phone_number to use on the href - $fields['trimmed_number'] = array_map( function( $item ) { - return str_replace( ' ', '', $item['phone_number'] ); - }, $fields['phone_repeater'] ); + foreach( $fields['phone_repeater'] as $i => $single_phone ) { + $fields['phone_repeater'][$i]['trimmed_number'] = str_replace( ' ', '', $single_phone['phone_number'] ); + } } return $fields; diff --git a/partials/shared/contact-item.dust b/partials/shared/contact-item.dust index 12be55ba..8ec01550 100644 --- a/partials/shared/contact-item.dust +++ b/partials/shared/contact-item.dust @@ -37,7 +37,7 @@
{phone_text|html}
- {phone_number|html}