From b901244d56d9cd4e45d436b2316ae71c9b6740ef Mon Sep 17 00:00:00 2001 From: Keegan Rankin Date: Wed, 30 Aug 2023 12:26:39 -0700 Subject: [PATCH] Prevent some more errors and warnings --- web/themes/custom/agarica/agarica.theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;