Skip to content

Commit

Permalink
Merge pull request #69 from neos/bugfix/makeDataAvailableForSchemaOfS…
Browse files Browse the repository at this point in the history
…ubprocesses

BUGFIX: Make previous data available to the fusion contexts before subprocesses are evaluated.
  • Loading branch information
mficzel authored Dec 10, 2021
2 parents 4f4d175 + 36f111a commit 07acc70
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public function handle(ActionRequest $request, array $data = []): void
$this->state = $this->formStateService->unserializeState($internalArguments['__state']);
}

// make the current `data` available to the context before sub processes are evaluated
// as those may have conditions that rely on previous data
$this->runtime->pushContext('data', $this->getData());

// evaluate the subprocesses this has to be done after the state was restored
// as the current data may affect @if conditions
$subProcesses = $this->getSubProcesses();
Expand Down Expand Up @@ -119,6 +123,9 @@ public function handle(ActionRequest $request, array $data = []): void
$request->setArgument('__submittedArgumentValidationResults', new Result());
}
}

// restore fusion context to the state before data was pushed
$this->runtime->popContext();
}

/**
Expand Down

0 comments on commit 07acc70

Please sign in to comment.