From e3ebfd6b0093411d36b0f7d7a60c2a4651d24b9a Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Fri, 30 Aug 2024 05:50:45 -0700 Subject: [PATCH] Don't ignore `null` assoc array values https://github.com/craftcms/cms/issues/10512#issuecomment-1053830465 --- CHANGELOG.md | 1 + src/helpers/ProjectConfig.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74891abd71b..c33f39b6533 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Fixed a SQL error that occurred when running the `db/convert-charset` command if there were any custom database views or sequences. ([#15598](https://github.com/craftcms/cms/issues/15598)) - Fixed a bug where `craft\helpers\Db::supportsTimeZones()` could return `false` on databases that supported time zone conversion. ([#15592](https://github.com/craftcms/cms/issues/15592)) - Fixed a bug where Assets fields were validating settings that weren’t applicable depending on the “Restrict assets to a single location” setting. ([#15545](https://github.com/craftcms/cms/issues/15545)) +- Fixed a bug where `null` values within associative arrays were ignored when applying project config data. ([#10512](https://github.com/craftcms/cms/issues/10512)) ## 4.11.5 - 2024-08-26 diff --git a/src/helpers/ProjectConfig.php b/src/helpers/ProjectConfig.php index 5d8d394db6b..bd3c1495c6a 100644 --- a/src/helpers/ProjectConfig.php +++ b/src/helpers/ProjectConfig.php @@ -418,7 +418,7 @@ public static function unpackAssociativeArray(array $array, bool $recursive = tr $associative = []; if (!empty($array[ProjectConfigService::ASSOC_KEY])) { foreach ($array[ProjectConfigService::ASSOC_KEY] as $items) { - if (!isset($items[0], $items[1])) { + if (!array_key_exists(0, $items) || !array_key_exists(1, $items)) { Craft::warning('Skipping incomplete packed associative array data', __METHOD__); continue; }