Problem/Motivation

A block with label_display: visible renders without its title in a display built with Display Builder.

Steps to reproduce

  1. Build a content display with Display Builder.
  2. Add the "Who's online" block with its label set to display, then Publish.
  3. View a node: the list shows, the "Who's online" title does not.

Proposed resolution

Render the label above the block content when label_display is set, as core does. A title given by the block, like a view title, wins.

Remaining tasks

  • ✅ File an issue about this project
  • ✅ Addition/Change/Update/Fix to this project
  • ✅ Testing to ensure no regression
  • ✅ Automated unit/functional testing coverage
  • ❌ Code review by maintainers

AI-Generated: Yes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rajab natshah created an issue. See original summary.

pdureau’s picture

Hello Rajab,

Is label_display a property of the block plugin or of the block config entity?

BlockSource is supposed (i say "supposed" because there may be some confusing bit in the implementation, i didn't check) load and manage a block plugin, not a block entity, so this distinction is important.

By the way:

Add the "Who's online" block with its label set to display, then Publish.

How did you do that? BlockSource::settingsForm() doesn't expose such settings as far as I know.

pdureau’s picture

Status: Active » Postponed (maintainer needs more info)
Add the "Who's online" block with its label set to display, then Publish.

How did you do that? BlockSource::settingsForm() doesn't expose such settings as far as I know.

The only blocks we have found with those kinds of options are the ones derived by Views.

However, they have "Title" string (views_label) and "Override title" (views_label_checkbox) boolean, provided by \Drupal\views\Plugin\Block\ViewsBlock instead of Title (label) and "Display title" (label_display) boolean.

So, what do we do?

  • Do we restore the label_display behaviour (like started in this MR)? A said before, it must be restored only if it is part of the block plugin API, not the config entity API, and to be honest I am not sure anymore. We need to check.
  • Do we only address the views_label? Can we address this without restoring label_display behaviour first?

Anyway, it looks like a UI Pattern issue because it is where the label_display is hidden: https://git.drupalcode.org/project/ui_patterns/-/blob/2.0.x/src/Plugin/U...

pdureau’s picture

Status: Postponed (maintainer needs more info) » Needs review
pdureau’s picture

Assigned: Unassigned » mogtofu33

To discuss (see last comment)

pdureau’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs review » Postponed

Bugs must be addressed before the end of beta phase. I guess the absence of tags put this one under the radar.

But we can't afford to open such a deep discussion about block plugin VS block config entities so late in development, so close to 1.0.0.