diff --git a/core/modules/block/block.install b/core/modules/block/block.install index 7e54e3f..305f438 100644 --- a/core/modules/block/block.install +++ b/core/modules/block/block.install @@ -124,7 +124,7 @@ function block_update_8003() { } /** - * Disables blocks that are placed into the "disabled" region. + * Disable blocks that are placed into the "disabled" region. */ function block_update_8004() { // Find all blocks in the disabled region. diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 5b30b4a..eeba0bb 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -145,7 +145,11 @@ function block_rebuild() { foreach ($blocks as $block_id => $block) { // Disable blocks in invalid regions. if (!isset($regions[$block->getRegion()]) && $block->status()) { - drupal_set_message(t('The block %info was assigned to the invalid region %region and has been disabled.', ['%info' => $block_id, '%region' => $block->getRegion()]), 'warning'); + // Do not display the invalid region message if the deprecated + // constant was used to disable the block. + if ($block->getRegion() !== BlockInterface::BLOCK_REGION_NONE) { + drupal_set_message(t('The block %info was assigned to the invalid region %region and has been disabled.', ['%info' => $block_id, '%region' => $block->getRegion()]), 'warning'); + } $block ->setRegion(system_default_region($theme)) ->disable() diff --git a/core/modules/block/src/Entity/Block.php b/core/modules/block/src/Entity/Block.php index 1a0c82c..8a1bcd8 100644 --- a/core/modules/block/src/Entity/Block.php +++ b/core/modules/block/src/Entity/Block.php @@ -35,7 +35,7 @@ * "delete-form" = "/admin/structure/block/manage/{block}/delete", * "edit-form" = "/admin/structure/block/manage/{block}", * "enable" = "/admin/structure/block/manage/{block}/enable", - * "disable" = "/admin/structure/block/manage/{block}/disable", + * "disable" = "/admin/structure/block/manage/{block}/disable" * }, * config_export = { * "id",