From 841b51491a835373693d823ea07b49db15bc0eda Mon Sep 17 00:00:00 2001 From: i-just Date: Thu, 9 Jan 2025 11:26:01 +0000 Subject: [PATCH 1/2] ensure the type is actually unset --- src/services/Entries.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/services/Entries.php b/src/services/Entries.php index cb472f5ed07..eb007992d27 100644 --- a/src/services/Entries.php +++ b/src/services/Entries.php @@ -966,7 +966,9 @@ private function _ensureSingleEntry(Section $section, ?array $siteSettings = nul // if we didn't find any, try without the typeId, // in case that changed to something completely new if ($entry === null) { - $entry = $baseEntryQuery->one(); + $entry = $baseEntryQuery + ->typeId(null) + ->one(); if ($entry !== null) { $entry->setTypeId($entryTypeIds[0]); @@ -977,6 +979,7 @@ private function _ensureSingleEntry(Section $section, ?array $siteSettings = nul // try without the typeId with trashed where they were deleted with entry type if ($entry === null) { $entry = $baseEntryQuery + ->typeId(null) ->trashed(null) ->where(['entries.deletedWithEntryType' => true]) ->one(); From da08dc0686f4b19c6fc1ae82ce4635e7e3fe4ff2 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Fri, 10 Jan 2025 19:21:30 -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 ed46e4083e1..57a66dcd5cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fixed a bug where the control panel could display a notice about the Craft CMS license belonging to a different domain, even when accessing the control panel from the correct domain. ([#16396](https://github.com/craftcms/cms/issues/16396)) - Fixed a bug where field layout elements’ action menus could have an empty action group. +- Fixed a bug where Single section entries could be duplicated after running the `entry-types/merge` command. ([#16394](https://github.com/craftcms/cms/issues/16394)) ## 5.5.9 - 2025-01-06