Skip to content

Commit

Permalink
Keep single sections' entry type handles in sync w/ section
Browse files Browse the repository at this point in the history
resolves #2824
  • Loading branch information
brandonkelly committed Apr 30, 2018
1 parent 3c919cb commit 4c40204
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/services/Sections.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
}
Expand Down

0 comments on commit 4c40204

Please sign in to comment.