Fix operator parsing on txn ops

This commit is contained in:
Jake Barnby 2025-11-12 16:48:42 +13:00
parent ae21fadf0d
commit c9582978ed
4 changed files with 12 additions and 4 deletions

View file

@ -107,7 +107,9 @@ class Update extends Action
throw new Exception($this->getParentNotFoundException());
}
$data = $this->parseOperators($data, $collection);
if ($transactionId === null) {
$data = $this->parseOperators($data, $collection);
}
$hasRelationships = \array_filter(
$collection->getAttribute('attributes', []),

View file

@ -107,7 +107,9 @@ class Upsert extends Action
}
foreach ($documents as $key => $document) {
$document = $this->parseOperators($document, $collection);
if ($transactionId === null) {
$document = $this->parseOperators($document, $collection);
}
$document = $this->removeReadonlyAttributes($document, privileged: true);
$documents[$key] = new Document($document);
}

View file

@ -112,7 +112,9 @@ class Update extends Action
throw new Exception($this->getParentNotFoundException());
}
$data = $this->parseOperators($data, $collection);
if ($transactionId === null) {
$data = $this->parseOperators($data, $collection);
}
// Read permission should not be required for update
/** @var Document $document */

View file

@ -118,7 +118,9 @@ class Upsert extends Action
throw new Exception($this->getParentNotFoundException());
}
$data = $this->parseOperators($data, $collection);
if ($transactionId === null) {
$data = $this->parseOperators($data, $collection);
}
$allowedPermissions = [
Database::PERMISSION_READ,