function RulesConditionBase::getContextValue

Overrides ContextAwarePluginTrait::getContextValue

4 calls to RulesConditionBase::getContextValue()
DataComparison::refineContextDefinitions in src/Plugin/Condition/DataComparison.php
Refines used and provided context definitions based upon context values.
EntityIsOfBundle::assertMetadata in src/Plugin/Condition/EntityIsOfBundle.php
Asserts additional metadata for the selected data.
RulesConditionBase::evaluate in src/Core/RulesConditionBase.php
Evaluates the condition and returns TRUE or FALSE accordingly.
TestTextCondition::evaluate in tests/modules/rules_test/src/Plugin/Condition/TestTextCondition.php
Evaluates the condition and returns TRUE or FALSE accordingly.

File

src/Core/RulesConditionBase.php, line 38

Class

RulesConditionBase
Base class for rules conditions.

Namespace

Drupal\rules\Core

Code

public function getContextValue($name) {
    try {
        return parent::getContextValue($name);
    } catch (ContextException $e) {
        // Catch the undocumented exception thrown when no context value is set
        // for a required context.
        // @todo Remove once https://www.drupal.org/node/2677162 is fixed.
        if (strpos($e->getMessage(), 'context is required') === FALSE) {
            throw $e;
        }
    }
}