error when shortcuts are defined on preprocess_menu

Created on 13 September 2024, 3 months ago
Updated 19 September 2024, 3 months ago

On drupal 11 + navigation module enable (but not tested on older versions),

With some shortcuts defined, the function dsfr4drupal_preprocess_menu trigger an error :

Error: Call to a member function label() on null in dsfr4drupal_preprocess_menu() (line 24 of themes/contrib/dsfr4drupal/includes/menu.theme).

dsfr4drupal_preprocess_menu()
call_user_func_array() (Line: 261)
Drupal\Core\Theme\ThemeManager->render() (Line: 446)
Drupal\Core\Render\Renderer->doRender() (Line: 203)
Drupal\Core\Render\Renderer->render() (Line: 120)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 593)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 119)
Drupal\Core\Render\Renderer->renderInIsolation() (Line: 146)
Drupal\Core\Render\Renderer->doRenderPlaceholder() (Line: 183)
Drupal\Core\Render\Renderer->renderPlaceholder() (Line: 709)
Drupal\big_pipe\Render\BigPipe->renderPlaceholder() (Line: 489)
Drupal\big_pipe\Render\BigPipe->Drupal\big_pipe\Render\{closure}()
Fiber->start() (Line: 496)
Drupal\big_pipe\Render\BigPipe->sendPlaceholders() (Line: 248)
Drupal\big_pipe\Render\BigPipe->sendContent() (Line: 113)
Drupal\big_pipe\Render\BigPipeResponse->sendContent() (Line: 395)
Symfony\Component\HttpFoundation\Response->send() (Line: 20)

the concerned code is

  $variables['aria_label'] = \Drupal::entityTypeManager()
    ->getStorage('menu')
    ->load($menu_name)
    ->label();

and when the error occurs $menu_name is set to shortcuts

๐Ÿ› Bug report
Status

Postponed: needs info

Version

1.1

Component

Code

Created by

๐Ÿ‡ซ๐Ÿ‡ทFrance Kgaut

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024