diff --git a/web/themes/custom/agarica/agarica.theme b/web/themes/custom/agarica/agarica.theme index fb83964..5630b67 100644 --- a/web/themes/custom/agarica/agarica.theme +++ b/web/themes/custom/agarica/agarica.theme @@ -19,7 +19,7 @@ function agarica_preprocess_node(&$variables) { $allowed_regions = ['secondary_menu']; agarica_add_regions_to_node($allowed_regions, $variables); } - $field_body_paragraph = $variables['elements']['field_body_paragraph']; + $field_body_paragraph = $variables['elements']['field_body_paragraph'] ?? NULL; if (isset($field_body_paragraph)) { $max_key = max(array_map('intval', array_keys($field_body_paragraph))); for ($i = 0; $i <= $max_key; $i++) { @@ -106,7 +106,7 @@ function agarica_languague_switch_link() { unset($links[$current_language]); // Check if the current path display an entity. - $entity = FALSE; + $entity = []; foreach (\Drupal::routeMatch()->getParameters() as $param) { if ($param instanceof EntityInterface) { $entity[] = $param;