diff --git a/core/lib/Drupal/Core/Plugin/Context/ContextHandler.php b/core/lib/Drupal/Core/Plugin/Context/ContextHandler.php index efe7158..7a5e332 100644 --- a/core/lib/Drupal/Core/Plugin/Context/ContextHandler.php +++ b/core/lib/Drupal/Core/Plugin/Context/ContextHandler.php @@ -101,9 +101,9 @@ public function applyContextMapping(ContextAwarePluginInterface $plugin, $contex } } - // if there are any required contexts without a value, throw an exception. + // If there are any required contexts without a value, throw an exception. if ($missing_value) { - throw new ContextException(SafeMarkup::format("Required contexts without a value: @contexts.", array('@contexts' => implode(', ', $missing_value)))); + throw new ContextException(sprintf('Required contexts without a value: %s.', implode(', ', $missing_value))); } // If there are any mappings that were not satisfied, throw an exception. diff --git a/core/modules/system/tests/modules/condition_test/src/Plugin/Condition/OptionalContextCondition.php b/core/modules/system/tests/modules/condition_test/src/Plugin/Condition/OptionalContextCondition.php index 986a66c..88c7d41 100644 --- a/core/modules/system/tests/modules/condition_test/src/Plugin/Condition/OptionalContextCondition.php +++ b/core/modules/system/tests/modules/condition_test/src/Plugin/Condition/OptionalContextCondition.php @@ -10,7 +10,10 @@ use Drupal\Core\Condition\ConditionPluginBase; /** - * Provides a condition with optional context. + * Provides a condition with an optional node context. + * + * The context type entity:node is used since that would allow to also use this + * for web tests with the node route context. * * @Condition( * id = "condition_test_optional_context",