By larowlan on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
9.3.x
Introduced in version:
9.3.0
Issue links:
Description:
Previously the context system would return FALSE for the hasContextValue method on a context object if the value was set to FALSE, even though this is a perfectly valid value.
Now, hasContextValue will return TRUE, only a value of NULL will cause hasContextValue to return FALSE
Before
$definition = new \Drupal\Core\Plugin\Context\ContextDefinition('boolean');
$context = new \Drupal\Component\Plugin\Context\Context($definition, FALSE);
$context->hasContextValue(); // Would return FALSE
After
$definition = new \Drupal\Core\Plugin\Context\ContextDefinition('boolean');
$context = new \Drupal\Component\Plugin\Context\Context($definition, FALSE);
$context->hasContextValue(); // Now returns TRUE
Impacts:
Module developers