Browse library link results in Uncaught PHP Exception Error

Created on 26 September 2023, over 1 year ago

Problem/Motivation

Clicking on the 'Browse library' link from Layout Builder's off-canvas results in the following AJAX error: An AJAX HTTP error occurred.\nHTTP Result Code: 500

Steps to reproduce

  1. On a vanilla Drupal 10.1 installation, enable layout_builder_browser_block_library module
  2. Navigate to /admin/structure/types/manage/page/display and enable Layout Builder by checking the two checkboxes: Use Layout Builder and Allow each content item to have its layout customized.
  3. Navigate to /admin/config/content/layout-builder-browser/categories and create a new block category
  4. Navigate to /admin/config/content/layout-builder-browser and place a block type (e.g. Inline blocks - Basic block) to the newly created block category
  5. Create a new basic page node
  6. Navigate to the new node's Layout tab
  7. On the node's Layout Builder page, click on +Add a new block link in a section to reveal the off-canvas toolbar
  8. Click on a Browse library link from the off-canvas

Proposed resolution

Based on following Php error, the fix is fairly simple: replace the deprecated method as per https://www.drupal.org/node/3195121

Uncaught PHP Exception Error: "Call to undefined method Drupal\layout_builder_browser_block_library\Controller\BrowserBlockLibraryController::getAvailableContexts()" at /Users/ezsemlye/Sites/d10_vanilla/web/modules/contrib/layout_builder_browser_block_library/src/Controller/BrowserBlockLibraryController.php line 118

Remaining tasks

Patch.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇭🇺Hungary zserno

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

Comments & Activities

Production build 0.71.5 2024