function BlockConfigUpdater::needsInfoStatusSettingsRemoved
Checks if the block contains deprecated info and status settings.
Parameters
\Drupal\block\BlockInterface $block: The block to update.
Return value
bool TRUE if the block has deprecated settings.
1 call to BlockConfigUpdater::needsInfoStatusSettingsRemoved()
- BlockConfigUpdater::updateBlock in core/
modules/ block/ src/ BlockConfigUpdater.php - Performs the required update.
File
-
core/
modules/ block/ src/ BlockConfigUpdater.php, line 67
Class
- BlockConfigUpdater
- Provides a BC layer for modules providing old configurations.
Namespace
Drupal\blockCode
public function needsInfoStatusSettingsRemoved(BlockInterface $block) : bool {
if (!str_starts_with($block->getPluginId(), 'block_content')) {
return FALSE;
}
$settings = $block->get('settings');
if (!isset($settings['info']) && !isset($settings['status'])) {
return FALSE;
}
$deprecations_triggered =& $this->triggeredDeprecations['3426302'][$block->id()];
if ($this->deprecationsEnabled && !$deprecations_triggered) {
$deprecations_triggered = TRUE;
@trigger_error('Block content blocks with the "status" and "info" settings is deprecated in drupal:11.3.0 and will be removed in drupal:12.0.0. They were unused, so there is no replacement. Profile, module and theme provided configuration should be updated. See https://www.drupal.org/node/3499836', E_USER_DEPRECATED);
}
return TRUE;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.