diff --git a/src/Appwrite/Utopia/Response/Model/Table.php b/src/Appwrite/Utopia/Response/Model/Table.php index e36cb1dabd..1855f471b1 100644 --- a/src/Appwrite/Utopia/Response/Model/Table.php +++ b/src/Appwrite/Utopia/Response/Model/Table.php @@ -118,17 +118,18 @@ class Table extends Model $columns = $this->remapNestedRelatedCollections($columns); } - $document - ->setAttribute('columns', $columns) - ->removeAttribute('attributes'); + $document->setAttribute('columns', $columns); $related = $document->getAttribute('relatedCollection'); if ($related !== null) { - $document - ->setAttribute('relatedTable', $related) - ->removeAttribute('relatedCollection'); + $document->setAttribute('relatedTable', $related); } + // remove anyways as they are already copied above. + $document + ->removeAttribute('attributes') + ->removeAttribute('relatedCollection'); + return $document; }