Compare commits

...
Author SHA1 Message Date
loks0nandClaude Opus 4.6 b4bfe1e854 Fix update document failing when nested relations have $id set
Convert all associative arrays to Document objects in the update
endpoint's $setCollection closure, not just those without $id. Arrays
with $id were left as raw arrays, causing RelationshipException in the
DB layer for oneToOne non-twoWay relationships.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 16:42:49 +00:00
@@ -205,9 +205,10 @@ class Update extends Action
if (
\is_array($relation)
&& \array_values($relation) !== $relation
&& !isset($relation['$id'])
) {
$relation['$id'] = ID::unique();
if (!isset($relation['$id'])) {
$relation['$id'] = ID::unique();
}
$relation = new Document($relation);
}