diff --git a/core/modules/contextual/contextual.module b/core/modules/contextual/contextual.module index 32986de5fb..055881cfe6 100644 --- a/core/modules/contextual/contextual.module +++ b/core/modules/contextual/contextual.module @@ -177,7 +177,10 @@ function _contextual_links_to_id($contextual_links) { $ids = []; $langcode = \Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_URL)->getId(); foreach ($contextual_links as $group => $args) { - $route_parameters = ((isset($args['rout_parameters']) && is_array($args['rout_parameters'])) ? UrlHelper::buildQuery($args['route_parameters']) : UrlHelper::buildQuery([])); + if (!isset($args['route_parameters']) || !is_array($args['route_parameters'])) { + \Drupal::logger('contextual')->error('Contextual link for group @group has broken route_parameters', ['@group' => $group]); + } + $route_parameters = UrlHelper::buildQuery($args['route_parameters']); $args += ['metadata' => []]; // Add the current URL language to metadata so a different ID will be // computed when URLs vary by language. This allows to store different