diff --git a/core/lib/Drupal/Core/Plugin/ContextAwarePluginAssignmentTrait.php b/core/lib/Drupal/Core/Plugin/ContextAwarePluginAssignmentTrait.php index 012bd30..fbef493 100644 --- a/core/lib/Drupal/Core/Plugin/ContextAwarePluginAssignmentTrait.php +++ b/core/lib/Drupal/Core/Plugin/ContextAwarePluginAssignmentTrait.php @@ -53,7 +53,7 @@ protected function addContextAssignmentElement(ContextAwarePluginInterface $plug ]; } - if (count($options) > 1 || !$definition->isRequired()) { + if (count($options) !== 0) { $assignments = $plugin->getContextMapping(); $element[$context_slot] = [ '#title' => $definition->getLabel() ?: $this->t('Select a @context value:', ['@context' => $context_slot]), diff --git a/core/modules/block/src/Tests/BlockLanguageTest.php b/core/modules/block/src/Tests/BlockLanguageTest.php index 265524f..f99c947 100644 --- a/core/modules/block/src/Tests/BlockLanguageTest.php +++ b/core/modules/block/src/Tests/BlockLanguageTest.php @@ -54,7 +54,7 @@ public function testLanguageBlockVisibility() { $this->drupalGet('admin/structure/block/add/system_powered_by_block' . '/' . $default_theme); $this->assertField('visibility[language][langcodes][en]', 'Language visibility field is visible.'); - $this->assertNoField('visibility[language][context_mapping][language]', 'Language type field is not visible.'); + $this->assertField('visibility[language][context_mapping][language]', 'Language type field is visible.'); // Enable a standard block and set the visibility setting for one language. $edit = array(