This commit is contained in:
2024-06-25 15:44:05 +02:00
parent 24a31fbcdc
commit 34b21110c7
+2
View File
@@ -117,6 +117,7 @@ function reha_preprocess_block(&$variables) {
function reha_preprocess_field(&$variables){ function reha_preprocess_field(&$variables){
if($variables['field_name'] === 'field_adresse_site'){ if($variables['field_name'] === 'field_adresse_site'){
foreach($variables['items'] as $index => $adr){ foreach($variables['items'] as $index => $adr){
if (isset($variables['items'][$index]['content']['postal_code'])) {
$postal_code = $variables['items'][$index]['content']['postal_code']['#value']; $postal_code = $variables['items'][$index]['content']['postal_code']['#value'];
$pattern = '/(\d{2})(\d+)/i'; $pattern = '/(\d{2})(\d+)/i';
$replacement = '($1)'; $replacement = '($1)';
@@ -124,3 +125,4 @@ function reha_preprocess_field(&$variables){
} }
} }
} }
}