Broken block leads to exception

Created on 28 June 2024, 5 months ago
Updated 13 July 2024, 4 months ago

Problem/Motivation

Passing a broken block reference to AdaptableBlockViewBuilder causes an error:
Error: Call to undefined method Drupal\Core\Block\Plugin\Block\Broken::setPagedesignerElement() in Drupal\pagedesigner_block_adaptable\AdaptableBlockViewBuilder::preRender()

Normally, Drupal would just show a notice about the block being broken. The error makes the page inaccessible.

Steps to reproduce

- Add an adaptable block to a page.
- Delete block in block layout
- Access page

Proposed resolution

- Add interface for AdaptableViewsBlock
- Check for correct interface before trying to use setPagedesignerElement

User interface changes

None

API changes

- Additional interface

Data model changes

None

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇨🇭Switzerland pvbergen

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