Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / block / src / BlockForm.php
index 04160432de13b9e7010ccb237158e2da5fa78a87..64f1aad7754a955572df90bd611e0b068bdc95ac 100644 (file)
@@ -239,7 +239,8 @@ class BlockForm extends EntityForm {
     // @todo Allow list of conditions to be configured in
     //   https://www.drupal.org/node/2284687.
     $visibility = $this->entity->getVisibility();
-    foreach ($this->manager->getDefinitionsForContexts($form_state->getTemporaryValue('gathered_contexts')) as $condition_id => $definition) {
+    $definitions = $this->manager->getFilteredDefinitions('block_ui', $form_state->getTemporaryValue('gathered_contexts'), ['block' => $this->entity]);
+    foreach ($definitions as $condition_id => $definition) {
       // Don't display the current theme condition.
       if ($condition_id == 'current_theme') {
         continue;
@@ -359,7 +360,7 @@ class BlockForm extends EntityForm {
     // Save the settings of the plugin.
     $entity->save();
 
-    drupal_set_message($this->t('The block configuration has been saved.'));
+    $this->messenger()->addStatus($this->t('The block configuration has been saved.'));
     $form_state->setRedirect(
       'block.admin_display_theme',
       [