Problem/Motivation

It was discovered in #3379725: Make Block config entities fully validatable that the provider exported property is unused.

This explains why all blocks have

provider: null

at the root, but then have another provider key that is not empty, under settings (so settings.provider).

For example, block.block.olivero_account_menu.yml:

langcode: en
status: true
dependencies:
  config:
    - system.menu.account
  module:
    - system
  theme:
    - olivero
id: olivero_account_menu
theme: olivero
region: secondary_menu
weight: -4
provider: null
plugin: 'system_menu_block:account'
settings:
  id: 'system_menu_block:account'
  label: 'User account menu'
  label_display: '0'
  provider: system
  level: 1
  depth: 1
  expand_all_items: false
visibility: {  }

Top-level null provider, but the "settings" provider is system, which makes sense: this is a block plugin provided by the System module.

This was introduced in #2432791: Skip Config::save schema validation of config data for trusted data and appears to have been an accident.

Note: the Block class has never had a $provider property 😅 Which is why we see provider: null in all block.block.*.yml files 😄

Steps to reproduce

N/A

Proposed resolution

  1. Mark block.block.*:provider as deprecated — this will trigger deprecation warnings for any code producing
  2. Remove provider from the config_export annotation for the Block config entity type
  3. Provide an update path that removes provider from EVERY block. That will ensure no deprecation warning is triggered anymore, unless the site owner restores old/invalid config.

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

None.

Comments

Wim Leers created an issue. See original summary.

wim leers’s picture

Status: Active » Postponed
longwave’s picture

Title: [PP-1] Deprecate unused `provider` exported property from Block config entities » Deprecate unused `provider` exported property from Block config entities
Status: Postponed » Active

Parent issue landed, so we can fix this now.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.