From 61a3e7c7356739dae72b7782c893bc71cab98e24 Mon Sep 17 00:00:00 2001 From: fogelito Date: Thu, 28 Aug 2025 14:55:38 +0300 Subject: [PATCH] Null fallback --- app/config/collections/projects.php | 6 +++--- .../Platform/Modules/Functions/Http/Functions/Create.php | 6 +++--- .../Platform/Modules/Functions/Http/Functions/Update.php | 4 ++-- .../Platform/Modules/Proxy/Http/Rules/Site/Create.php | 2 +- src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php | 4 ++-- src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/config/collections/projects.php b/app/config/collections/projects.php index 2cf5702b4a..771b6eac09 100644 --- a/app/config/collections/projects.php +++ b/app/config/collections/projects.php @@ -2444,10 +2444,10 @@ return [ ], [ '$id' => ID::custom('resourceInternalId'), - 'type' => Database::VAR_ID, + 'type' => Database::VAR_STRING, // Not numeric 'format' => '', - 'size' => 0, - 'signed' => false, + 'size' => Database::LENGTH_KEY, + 'signed' => true, 'required' => true, 'default' => null, 'array' => false, diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php index 21a74f9a81..348dee5794 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php @@ -209,7 +209,7 @@ class Create extends Base 'logging' => $logging, 'name' => $name, 'runtime' => $runtime, - 'deploymentInternalId' => '', + 'deploymentInternalId' => null, 'deploymentId' => '', 'events' => $events, 'schedule' => $schedule, @@ -225,7 +225,7 @@ class Create extends Base 'installationInternalId' => $installation->getSequence(), 'providerRepositoryId' => $providerRepositoryId, 'repositoryId' => '', - 'repositoryInternalId' => '', + 'repositoryInternalId' => null, 'providerBranch' => $providerBranch, 'providerRootDirectory' => $providerRootDirectory, 'providerSilentMode' => $providerSilentMode, @@ -370,7 +370,7 @@ class Create extends Base 'type' => 'deployment', 'trigger' => 'manual', 'deploymentId' => !isset($deployment) || $deployment->isEmpty() ? '' : $deployment->getId(), - 'deploymentInternalId' => !isset($deployment) || $deployment->isEmpty() ? '' : $deployment->getSequence(), + 'deploymentInternalId' => $deployment->getSequence(), 'deploymentResourceType' => 'function', 'deploymentResourceId' => $function->getId(), 'deploymentResourceInternalId' => $function->getSequence(), diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php index aaff953af0..146dd833df 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php @@ -164,7 +164,7 @@ class Update extends Base $enabled ??= $function->getAttribute('enabled', true); $repositoryId = $function->getAttribute('repositoryId', ''); - $repositoryInternalId = $function->getAttribute('repositoryInternalId', ''); + $repositoryInternalId = $function->getAttribute('repositoryInternalId'); if (empty($entrypoint)) { $entrypoint = $function->getAttribute('entrypoint', ''); @@ -191,7 +191,7 @@ class Update extends Base $providerRootDirectory = ''; $providerSilentMode = true; $repositoryId = ''; - $repositoryInternalId = ''; + $repositoryInternalId = null; } // Git connect logic diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Site/Create.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Site/Create.php index 43cf09eaca..882cd2d038 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Site/Create.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Site/Create.php @@ -183,7 +183,7 @@ class Create extends Action 'type' => 'deployment', 'trigger' => 'manual', 'deploymentId' => $deployment->isEmpty() ? '' : $deployment->getId(), - 'deploymentInternalId' => $deployment->isEmpty() ? '' : $deployment->getSequence(), + 'deploymentInternalId' => $deployment->getSequence(), 'deploymentResourceType' => 'site', 'deploymentResourceId' => $site->getId(), 'deploymentResourceInternalId' => $site->getSequence(), diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php index 9be95441cb..d1d6a5c838 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php @@ -145,7 +145,7 @@ class Create extends Base 'logging' => $logging, 'name' => $name, 'framework' => $framework, - 'deploymentInternalId' => '', + 'deploymentInternalId' => null, 'deploymentId' => '', 'timeout' => $timeout, 'installCommand' => $installCommand, @@ -157,7 +157,7 @@ class Create extends Base 'installationInternalId' => $installation->getSequence(), 'providerRepositoryId' => $providerRepositoryId, 'repositoryId' => '', - 'repositoryInternalId' => '', + 'repositoryInternalId' => null, 'providerBranch' => $providerBranch, 'providerRootDirectory' => $providerRootDirectory, 'providerSilentMode' => $providerSilentMode, diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php index 80354d5067..17355cae91 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php @@ -166,7 +166,7 @@ class Update extends Base $enabled ??= $site->getAttribute('enabled', true); $repositoryId = $site->getAttribute('repositoryId', ''); - $repositoryInternalId = $site->getAttribute('repositoryInternalId', ''); + $repositoryInternalId = $site->getAttribute('repositoryInternalId'); $isConnected = !empty($site->getAttribute('providerRepositoryId', '')); @@ -189,7 +189,7 @@ class Update extends Base $providerRootDirectory = ''; $providerSilentMode = true; $repositoryId = ''; - $repositoryInternalId = ''; + $repositoryInternalId = null; } // Git connect logic