Error with core navigation module.

Created on 14 October 2024, about 1 month ago

Problem/Motivation

When installed alongside core's `navigation` module, the `/admin/config/user-interface/navigation-block` throws a fatal error...

The website encountered an unexpected error. Try again later.

TypeError: Drupal\layout_builder\Access\LayoutBuilderAccessCheck::access(): Argument #1 ($section_storage) must be of type Drupal\layout_builder\SectionStorageInterface, null given in Drupal\layout_builder\Access\LayoutBuilderAccessCheck->access() (line 35 of core/modules/layout_builder/src/Access/LayoutBuilderAccessCheck.php).
call_user_func_array(Array, Array) (Line: 160)
Drupal\Core\Access\AccessManager->performCheck('access_check.entity.layout_builder_access', Object) (Line: 136)
Drupal\Core\Access\AccessManager->check(Object, Object, NULL, ) (Line: 93)
Drupal\Core\Access\AccessManager->checkNamedRoute('section_library.add_template_to_library', Array, NULL, ) (Line: 832)
Drupal\Core\Url->access() (Line: 140)
Drupal\section_library\SectionLibraryRender::preRender(Array)

Steps to reproduce

  1. Create a simplytest.me site with Drupal core 10.3.6 and the `section_library` module.
  2. Go to the /admin/modules page and install the `navigation` module.
  3. Navigate to the navigation blocks page (/admin/config/user-interface/navigation-block) and observe the error.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇺🇸United States dpagini

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

Comments & Activities

  • Issue created by @dpagini
  • 🇮🇳India sarwan_verma

    Hi,

    I tried this code, and the issue has been resolved .

    public function access(SectionStorageInterface $section_storage = null, AccountInterface $account, Route $route) {
    if ($section_storage === null) {
    return AccessResult::forbidden();
    }

    Thanks!

Production build 0.71.5 2024