diff --git a/core/lib/Drupal/Core/Block/BlockBase.php b/core/lib/Drupal/Core/Block/BlockBase.php index 9963132..66f6cb3 100644 --- a/core/lib/Drupal/Core/Block/BlockBase.php +++ b/core/lib/Drupal/Core/Block/BlockBase.php @@ -163,8 +163,7 @@ protected function blockAccess(AccountInterface $account) { */ public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $definition = $this->getPluginDefinition(); - $temporary = $form_state->getTemporary(); - $contexts = isset($temporary['gathered_contexts']) ? $temporary['gathered_contexts'] : []; + $contexts = $form_state->getTemporaryValue('gathered_contexts') ?: []; $form['context_mapping'] = $this->addContextAssignmentElement($this, $contexts); $form['provider'] = array( '#type' => 'value', diff --git a/core/modules/aggregator/src/Entity/Feed.php b/core/modules/aggregator/src/Entity/Feed.php index 6532f36..6125e16 100644 --- a/core/modules/aggregator/src/Entity/Feed.php +++ b/core/modules/aggregator/src/Entity/Feed.php @@ -114,9 +114,13 @@ public static function postDelete(EntityStorageInterface $storage, array $entiti parent::postDelete($storage, $entities); if (\Drupal::moduleHandler()->moduleExists('block')) { // Make sure there are no active blocks for these feeds. + $context_ids = array_keys($entities); + foreach ($context_ids as $key => $value) { + $context_ids[$key] = 'aggregator.feed:' . $value; + } $ids = \Drupal::entityQuery('block') ->condition('plugin', 'aggregator_feed_block') - ->condition('settings.feed', array_keys($entities)) + ->condition('settings.context_mapping.feed', $context_ids) ->execute(); if ($ids) { $block_storage = \Drupal::entityManager()->getStorage('block');