Change \Drupal\Core\Block\BlockPluginInterface::BLOCK_LABEL_HIDDEN value for consistency

Created on 23 March 2017, over 7 years ago
Updated 31 January 2023, almost 2 years ago

Follow-up to ✨ Add option for visually-hidden block titles Needs work

Problem/Motivation

During ✨ Add option for visually-hidden block titles Needs work we are introducing new label_display options to manage the blocks' title display. For backward compatibility, we have to keep the existing value of the title being hidden to "0" what's not consistent with the other options ("visible" and "visually_hidden").
In Drupal 9, we should change the value of the \Drupal\Core\Block\BlockPluginInterface::BLOCK_LABEL_HIDDEN constant to "hidden" for consistency. And adjust all related stuff like preprocesses or templates that relies on that value.

Proposed resolution

  • change \Drupal\Core\Block\BlockPluginInterface::BLOCK_LABEL_HIDDEN value to "hidden"
  • adapt core/themes/stable/templates/block/block--system-menu-block.html.twig
  • adapt core/themes/classy/templates/block/block--system-menu-block.html.twig
  • adapt core/modules/system/templates/block--system-menu-block.html.twig
  • adapt template_preprocess_block
  • update hook for existing sites, to change stored 0 values to hidden
  • updates to default installation config (profiles)

Remaining tasks

Wait till D9

User interface changes

None

API changes

None

Data model changes

block.block.*:settings.label_display value is now "hidden" when the title is disabled

πŸ“Œ Task
Status

Needs work

Version

10.1 ✨

Component
BlockΒ  β†’

Last updated about 16 hours ago

Created by

πŸ‡«πŸ‡·France duaelfr Montpellier, France

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.

Production build 0.71.5 2024