From 565128717703d1d71c1f5b3086633b0d7936ca54 Mon Sep 17 00:00:00 2001 From: Iwona Just Date: Thu, 28 Nov 2024 12:39:28 +0000 Subject: [PATCH 1/2] when applying pc, ensure we have the most up to date field before assigning old settings --- src/services/Fields.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/services/Fields.php b/src/services/Fields.php index ebd50cfb2f0..7b4ea793c94 100644 --- a/src/services/Fields.php +++ b/src/services/Fields.php @@ -1677,6 +1677,13 @@ public function applyFieldSave(string $fieldUid, array $data, string $context): $field ??= $this->getFieldById($fieldRecord->id); $field->id = $fieldRecord->id; } else { + // if it's not a control panel save request, get the field again + // so that it has the new settings + // https://github.com/craftcms/cms/issues/16227 + if (!isset($this->_savingFields[$fieldUid])) { + $field = $this->getFieldById($fieldRecord->id); + } + // Save the old field handle and settings on the model in case the field type needs to do something with it. $field->oldHandle = $fieldRecord->getOldHandle(); $field->oldSettings = is_string($oldSettings) ? Json::decode($oldSettings) : null; From 454606840b1e9986509b63d105fcd3854a3aab93 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Sun, 1 Dec 2024 05:44:25 -0800 Subject: [PATCH 2/2] Release note [ci skip] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1ed4dfe7c7..c0afb7fc09a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Fixed an error that could occur when duplicating an element with an Assets field that had a dynamic subpath. ([#16214](https://github.com/craftcms/cms/issues/16214)) - Reduced the likelihood of a deadlock error occurring when updating search indexes. ([#15221](https://github.com/craftcms/cms/issues/15221)) - Fixed a bug where renaming asset folders could move them to the webroot on Windows. ([#16215](https://github.com/craftcms/cms/issues/16215)) +- Fixed a bug where Matrix fields’ content tables weren’t getting renamed properly when applying project config changes. ([#16227](https://github.com/craftcms/cms/issues/16227)) ## 4.13.3 - 2024-11-22