Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
GenericEventSubscriber::onRulesEvent has
// Loop over all rules and execute them.
foreach ($configs as $config) {
/** @var \Drupal\rules\Entity\ReactionRule $config */
$config->getExpression()
->executeWithState($state);
}
That needs to be improved to clone the state per Rule, but merge back changes to the state as necessary; i.e. auto-saved variables need to be merged back.
When implementing this, check the d7 logic. But cloning $state while keeping the references on the typed data object should work. So adding/removing variables and blocked variables does not change the parent scope, while saved changes need to be handled.
This is important here, but also for things like handling RulesLoop execution and evaluating components.
Comments
Comment #2
TR CreditAttribution: TR commentedBump.
Comment #3
TR CreditAttribution: TR commented