BlockComponentRenderArray::onBuildRender() does not check block access in Preview mode

Created on 5 May 2024, 7 months ago
Updated 7 May 2024, 7 months ago

Problem/Motivation

BlockComponentRenderArray::onBuildRender() does not check access to blocks before being rendered in the Edit Layout page for a given entity in Preview mode.

That could be problematic when Block::Access() prevents access to the block for any specific reason.

It could en up in fatal errors like the one reported in πŸ› Fatal error when accessing Navigation Blocks on a minimal profile installation because of the Shortcut block Needs work , where Block access is based on the presence of a 3rd party module.

Steps to reproduce

Install Drupal 11.x using Minimal profile and install Navigation module
Try to access to Navigation Layout settings page: /admin/config/user-interface/navigation-block
500 error is thrown because Shortcut module is not available

Proposed resolution

Check for block access in BlockComponentRenderArray::onBuildRender() before rendering it.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Closed: works as designed

Version

11.0 πŸ”₯

Component
Layout builderΒ  β†’

Last updated about 4 hours ago

Created by

πŸ‡ͺπŸ‡ΈSpain plopesc Valladolid

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