Merge pull request #10214 from appwrite/fix-nulls

Fix document nulls
This commit is contained in:
Jake Barnby 2025-07-29 18:16:01 +12:00 committed by GitHub
commit e57364c831
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 12 deletions

View file

@ -93,7 +93,7 @@ App::post('/v1/storage/buckets')
$bucketId = $bucketId === 'unique()' ? ID::unique() : $bucketId;
// Map aggregate permissions into the multiple permissions they represent.
$permissions = Permission::aggregate($permissions);
$permissions = Permission::aggregate($permissions) ?? [];
$compression ??= Compression::NONE;
$encryption ??= true;
try {
@ -146,7 +146,7 @@ App::post('/v1/storage/buckets')
$bucket = $dbForProject->getDocument('buckets', $bucketId);
$dbForProject->createCollection('bucket_' . $bucket->getSequence(), $attributes, $indexes, permissions: $permissions ?? [], documentSecurity: $fileSecurity);
$dbForProject->createCollection('bucket_' . $bucket->getSequence(), $attributes, $indexes, permissions: $permissions, documentSecurity: $fileSecurity);
} catch (DuplicateException) {
throw new Exception(Exception::STORAGE_BUCKET_ALREADY_EXISTS);
}

View file

@ -52,7 +52,7 @@
"utopia-php/cache": "0.13.*",
"utopia-php/cli": "0.15.*",
"utopia-php/config": "0.2.*",
"utopia-php/database": "0.73.0",
"utopia-php/database": "0.73.*",
"utopia-php/detector": "0.1.*",
"utopia-php/domains": "0.8.*",
"utopia-php/dsn": "0.2.1",

16
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "f4876940be4499bea26a77a036dece4f",
"content-hash": "f152305ec0b90245773867cde288582d",
"packages": [
{
"name": "adhocore/jwt",
@ -3493,16 +3493,16 @@
},
{
"name": "utopia-php/database",
"version": "0.73.0",
"version": "0.73.2",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/database.git",
"reference": "f9b6c587e54069dc64c2d29174ce8a42b7ba6491"
"reference": "68545dfd5d1ac41ca2f4f5a59719b890fcd8f480"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/database/zipball/f9b6c587e54069dc64c2d29174ce8a42b7ba6491",
"reference": "f9b6c587e54069dc64c2d29174ce8a42b7ba6491",
"url": "https://api.github.com/repos/utopia-php/database/zipball/68545dfd5d1ac41ca2f4f5a59719b890fcd8f480",
"reference": "68545dfd5d1ac41ca2f4f5a59719b890fcd8f480",
"shasum": ""
},
"require": {
@ -3543,9 +3543,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/database/issues",
"source": "https://github.com/utopia-php/database/tree/0.73.0"
"source": "https://github.com/utopia-php/database/tree/0.73.2"
},
"time": "2025-07-27T04:10:06+00:00"
"time": "2025-07-29T03:23:04+00:00"
},
{
"name": "utopia-php/detector",
@ -8239,7 +8239,7 @@
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {},
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {

View file

@ -85,7 +85,7 @@ class Update extends Action
throw new Exception($this->getNotFoundException());
}
$permissions ??= $collection->getPermissions() ?? [];
$permissions ??= $collection->getPermissions();
// Map aggregate permissions into the multiple permissions they represent.
$permissions = Permission::aggregate($permissions);