Blocks that have #attached set removed after upgrade

Created on 16 January 2023, almost 2 years ago
Updated 20 January 2023, almost 2 years ago

Problem/Motivation

In πŸ› Element::isEmpty() should check for #weight property Fixed a new way of checking whether a block is empty was introduced: before this, a block was considered empty if it only had a key of '#cache' set.
It was possible to return '#attached' and inject libraries etc into block content.

Ref https://github.com/drupal/drupal/commit/c3f6ce5cc04d7dc99ccc2eeebf72819d...

Steps to reproduce

* Make a block plugin that returns '#attached' only
* block will not be rendered

Proposed resolution

I'll work on a patch. As a workaround set a '#dummy' key in your block plugin

Remaining tasks

  • make a patch

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Fixed

Version

9.5

Component
BlockΒ  β†’

Last updated 3 days ago

Created by

miiimooo Europe

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to Needs work almost 2 years ago
  • Status changed to Needs review almost 2 years ago
  • Status changed to RTBC almost 2 years ago
  • Status changed to Fixed almost 2 years ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024