From 4c4020487c78b58403e3764cf1783c9012c66fe9 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Mon, 30 Apr 2018 12:40:34 -0700 Subject: [PATCH] Keep single sections' entry type handles in sync w/ section resolves #2824 --- CHANGELOG-v3.md | 1 + src/services/Sections.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-v3.md b/CHANGELOG-v3.md index 903186da04c..582bacd7932 100644 --- a/CHANGELOG-v3.md +++ b/CHANGELOG-v3.md @@ -6,6 +6,7 @@ - Fields’ translation icons now reveal the chosen Translation Method in their tooltip. ([#2808](https://github.com/craftcms/cms/issues/2808)) - Improved the error messages displayed when an Assets field has an invalid Upload Location setting. ([#2803](https://github.com/craftcms/cms/issues/2803)) - Craft now logs errors that occur when saving and replacing assets. ([#2814](https://github.com/craftcms/cms/issues/2814)) +- Single sections’ entry types’ handles are now updated to match their section’s handle whenever the section is saved. ([#2824](https://github.com/craftcms/cms/issues/2824)) - The Control Panel background color was lightened up a bit. ### Fixed diff --git a/src/services/Sections.php b/src/services/Sections.php index d6be085b7ce..1189ccca808 100644 --- a/src/services/Sections.php +++ b/src/services/Sections.php @@ -1176,11 +1176,12 @@ private function _onSaveSingle(Section $section, bool $isNewSection, array $allS } } - // Update the remaining entry type's name, if this isn't a new section + // Update the remaining entry type's name and handle, if this isn't a new section // --------------------------------------------------------------------- if (!$isNewSection) { $entryTypes[$entry->typeId]->name = $section->name; + $entryTypes[$entry->typeId]->handle = $section->handle; $this->saveEntryType($entryTypes[$entry->typeId]); } }