Creating blocks that depend on content via the config installer often generates a warning

Created on 16 January 2024, 8 months ago
Updated 15 March 2024, 6 months ago

Problem/Motivation

When you install from config or sync any configuration that create a block that depends on a block_content entity you'll see a message like:
[warning] The "block_content:05ef5bcb-3a2d-4ea8-b4a9-5d8407878401" was not found in the Drush output or in the Dblog.

This comes from \Drupal\Core\Block\BlockManager::handlePluginNotFound(). Originally I thought this could be addressed by doing πŸ› Add ConfigImporter to \Drupal\Core\Config\Importer\MissingContentEvent Fixed and πŸ“Œ Add handling of ConfigEvent::IMPORT_MISSING_CONTENT Needs review I'd be able to mitigate this but that's not the case because the BlockManager has already produced the error.

Steps to reproduce

Install a site from config with a block_content dependent block.

Proposed resolution

  • Fix ConfigEntityBase to not create plugin instances when saving config entities while syncing. The config is not going to change due to something changing the plugin but not the config.
  • Fix \Drupal\Tests\ckeditor5\Kernel\SmartDefaultSettingsTest to not abuse the setSyncing() behaviour to get around the fact that the ckeditor plugin no longer exists in Drupal 10. See #3270734: Update Editor + CKEditor 5 module to not use CKEditor 4 in tests β†’ for where this work-around was added.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Fixed

Version

10.3 ✨

Component
BlockΒ  β†’

Last updated 3 days ago

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024