diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module index bca5322..4400c55 100644 --- a/core/modules/aggregator/aggregator.module +++ b/core/modules/aggregator/aggregator.module @@ -336,7 +336,7 @@ function aggregator_save_category($edit) { // Make sure there is no active block for this category. if (Drupal::moduleHandler()->moduleExists('block')) { $event = new GenericEvent('aggregator_category_block:' . $edit['cid']); - \Drupal::service('event_dispatcher')->dispatch(BlockPluginEvents::DISAPPEAR_PERMANENT, $event); + Drupal::service('event_dispatcher')->dispatch(BlockPluginEvents::DISAPPEAR_PERMANENT, $event); } $edit['title'] = ''; $op = 'delete'; diff --git a/core/modules/block/lib/Drupal/block/BlockEntityBlockEventSubscriber.php b/core/modules/block/lib/Drupal/block/BlockEntityBlockEventSubscriber.php index 3070353..c2a0fa8 100644 --- a/core/modules/block/lib/Drupal/block/BlockEntityBlockEventSubscriber.php +++ b/core/modules/block/lib/Drupal/block/BlockEntityBlockEventSubscriber.php @@ -47,8 +47,8 @@ public static function getSubscribedEvents() { */ public function deleteEntityByPlugin(GenericEvent $event) { $plugin_id = $event->getSubject(); - foreach ($this->blockStorageController->loadByProperties(array('plugin' => $plugin_id)) as $block) { - $block->delete(); + if ($blocks = $this->blockStorageController->loadByProperties(array('plugin' => $plugin_id))) { + $this->blockStorageController->delete($blocks); } } diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index ccb7d0b..2f9ce6b 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -305,7 +305,6 @@ function menu_menu_predelete(Menu $menu) { function menu_menu_delete(Menu $menu) { menu_cache_clear_all(); - // Inform the block plugin system you have deleted a menu. // Inform the block plugin system that a menu has been deleted. if (Drupal::moduleHandler()->moduleExists('block')) { $event = new GenericEvent('menu_menu_block:' . $menu->id());