- First commit to issue fork.
- πΊπΈUnited States tr Cascadia
@jeremey1606: Are you planning on doing something here?
Conditions and Actions may provide context variables by using the "provides" key in the plugin annotation. For example, the annotation of the "Add a variable" action looks like this:
* @RulesAction(
* id = "rules_variable_add",
* label = @Translation("Add a variable"),
* category = @Translation("Data"),
* context = {
* "type" = @ContextDefinition("string",
* label = @Translation("Type"),
* description = @Translation("Specifies the type of the variable that should be added."),
* assignment_restriction = "input"
* ),
* "value" = @ContextDefinition("any",
* label = @Translation("Value"),
* description = @Translation("Optionally, specify the initial value of the variable."),
* required = FALSE
* ),
* },
* provides = {
* "variable_added" = @ContextDefinition("any",
* label = @Translation("Added variable")
* ),
* }
* )
This "provides" key allows the action to add a variable, named "variable_added" into the context for the Rule.
The problem is that it appears "variable_added" is always available in the context, for every other condition or action, even those that are defined BEFORE the variable is added. This is not right - the added variable should only be in the context of conditions or actions that appear AFTER the variable is added.
We could use tests to demonstrate the problem, and to demonstrate the fix when we have one.
Active
4.0
Rules Core
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
@jeremey1606: Are you planning on doing something here?