From f315e759f3c23c1f879eee5fa37a791f9d488178 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 9 Apr 2026 08:31:39 +0000 Subject: [PATCH] fix: map deprecated platform types in subQueryPlatforms filter The subQueryPlatforms database filter loads platforms as a sub-attribute when project documents are fetched. Old platform type values stored in the database (e.g. flutter-android, flutter-ios) were not being mapped to the new consolidated types before being included in the project response sent to the frontend/console. This adds Platform::mapDeprecatedType() to the filter so all platforms returned as part of a project document have their types mapped consistently, complementing the existing mapping in the dedicated platform Get and List endpoints. Co-Authored-By: Claude Opus 4.6 (1M context) --- app/init/database/filters.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/init/database/filters.php b/app/init/database/filters.php index c2ba091529..5a65479424 100644 --- a/app/init/database/filters.php +++ b/app/init/database/filters.php @@ -1,5 +1,6 @@ getAuthorization()->skip(fn () => $database + $platforms = $database->getAuthorization()->skip(fn () => $database ->find('platforms', [ Query::equal('projectInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), ])); + + foreach ($platforms as $platform) { + $platform->setAttribute('type', Platform::mapDeprecatedType($platform->getAttribute('type'))); + } + + return $platforms; } );