Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/Listener/OptimisticLock.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,9 @@ public function __invoke(OnDelete|OnUpdate $event): void

private function lock(Node $node, State $state, ScopeCarrierInterface $command): WrappedStoreCommand
{
$nodeValue = $node->getData()[$this->field] ?? null;
if ($nodeValue === null) {
throw new OptimisticLockException(\sprintf('The `%s` field is not set.', $this->field));
}
$nodeValue = $state->getTransactionData()[$this->field] ?? throw new OptimisticLockException(
\sprintf('The field %s.%s is not set.', $node->getRole(), $this->field),
);

// Process known rule
if ($this->isKnownRule) {
Expand Down
Loading