diff --git a/core/lib/Drupal/Component/Plugin/Context/Context.php b/core/lib/Drupal/Component/Plugin/Context/Context.php index 281d127..c891e62 100644 --- a/core/lib/Drupal/Component/Plugin/Context/Context.php +++ b/core/lib/Drupal/Component/Plugin/Context/Context.php @@ -71,7 +71,7 @@ public function getContextValue() { * {@inheritdoc} */ public function hasContextValue() { - return $this->contextValue || $this->getContextDefinition()->getDefaultValue(); + return (bool) $this->contextValue || (bool) $this->getContextDefinition()->getDefaultValue(); } /** diff --git a/core/lib/Drupal/Core/Plugin/Context/Context.php b/core/lib/Drupal/Core/Plugin/Context/Context.php index ec62033..6178398 100644 --- a/core/lib/Drupal/Core/Plugin/Context/Context.php +++ b/core/lib/Drupal/Core/Plugin/Context/Context.php @@ -60,7 +60,7 @@ public function getContextValue() { * {@inheritdoc} */ public function hasContextValue() { - return $this->contextData || parent::hasContextValue(); + return (bool) $this->contextData || parent::hasContextValue(); } /**