diff --git a/CHANGELOG-v3.md b/CHANGELOG-v3.md index 86ac37cb453..beb10e3e9a1 100644 --- a/CHANGELOG-v3.md +++ b/CHANGELOG-v3.md @@ -11,6 +11,7 @@ - Fixed a bug where pressing the Esc key in the setup wizard would close the modal window. ([#4307](https://github.com/craftcms/cms/issues/4307)) - Fixed a bug where `craft\validators\ArrayValidator::validate()` didn’t work. ([#4309](https://github.com/craftcms/cms/pull/4309)) - Fixed an error that could occur when rendering templates with a `loop.parent.loop` reference in a nested for-loop. ([#4271](https://github.com/craftcms/cms/issues/4271)) +- Fixed a bug where publishing a Single entry’s draft, or reverting a Single entry to a prior version, would overwrite its title to the section name. ([#4323](https://github.com/craftcms/cms/pull/4323)) ## 3.1.28 - 2019-05-21 diff --git a/src/services/EntryRevisions.php b/src/services/EntryRevisions.php index 34d5e0ebd15..31a8eed38cc 100644 --- a/src/services/EntryRevisions.php +++ b/src/services/EntryRevisions.php @@ -246,11 +246,6 @@ public function saveDraft(EntryDraft $draft, bool $runValidation = true): bool */ public function publishDraft(EntryDraft $draft, bool $runValidation = true): bool { - // If this is a single, we'll have to set the title manually - if ($draft->getSection()->type == Section::TYPE_SINGLE) { - $draft->title = $draft->getSection()->name; - } - // Set the version notes if (!$draft->revisionNotes) { $draft->revisionNotes = Craft::t('app', 'Published draft “{name}”.', ['name' => $draft->name]); @@ -458,11 +453,6 @@ public function saveVersion(Entry $entry): bool */ public function revertEntryToVersion(EntryVersion $version, bool $runValidation = true): bool { - // If this is a single, we'll have to set the title manually - if ($version->getSection()->type === Section::TYPE_SINGLE) { - $version->title = $version->getSection()->name; - } - // Set the version notes $version->revisionNotes = Craft::t('app', 'Reverted version {num}.', ['num' => $version->num]);