Make View blocks (block.settings.view_block:*) fully validatable

Created on 24 April 2025, about 4 hours ago

Problem/Motivation

📌 Make Block config entities fully validatable Fixed made Block config entities fully validatable, and the settings for 2 block plugins:

  1. content blocks (block.settings.block_content:*:) (see block_content.schema.yml
  2. the search form block block.settings.search_form_block (see search.schema.yml)

Steps to reproduce

N/A

Proposed resolution

Also make

views_block:
  type: block_settings
  label: 'View block'
  mapping:
    views_label:
      type: label
      label: 'Title'
    items_per_page:
      type: string
      label: 'Items per block'

block.settings.views_block:*:
  type: views_block

fully validatable.

Confusingly:

  • views_label is made available by \Drupal\views\Plugin\Block\ViewsBlockBase::buildConfigurationForm()
  • items_per_page is made available by \Drupal\views\Plugin\views\display\Block::blockForm()

The two are brought together into a single form by a third method: \Drupal\views\Plugin\Block\ViewsBlock::blockForm()

So … this seems surprisingly simple? 😄 All the actual control over the block lives in the associated View entity, not in the Views Block's configuration! Lucky us: no need for an update path! 😄

Remaining tasks

  1. Add the missing config schema.
  2. Review.

User interface changes

None.

Introduced terminology

None.

API changes

None.

Data model changes

TBD

Release notes snippet

TBD

📌 Task
Status

Active

Version

11.1 🔥

Component

views.module

Created by

🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

Live updates comments and jobs are added and updated live.
  • Contributed project blocker

    It denotes an issue that prevents porting of a contributed project to the stable version of Drupal due to missing APIs, regressions, and so on.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024