Skip to content

Commit

Permalink
Fixed #16476
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Jan 22, 2025
1 parent 2003fc0 commit ee9ac81
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for Craft CMS 4

## Unreleased

- Fixed an error that occurred when creating a new Structure section. ([#16476](https://github.com/craftcms/cms/issues/16476))

## 4.14.0.1 - 2025-01-21

- Fixed an error that occurred when referencing a single section entry by its handle. ([#16474](https://github.com/craftcms/cms/issues/16474))
Expand Down
4 changes: 2 additions & 2 deletions src/services/Sections.php
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,8 @@ public function handleChangedSection(ConfigEvent $event): void
// see https://github.com/craftcms/cms/issues/16450
if (
$isNewStructure &&
$event->oldValue['type'] === Section::TYPE_STRUCTURE &&
$event->oldValue['structure']['uid'] !== $structureUid &&
($event->oldValue['type'] ?? null) === Section::TYPE_STRUCTURE &&
($event->oldValue['structure']['uid'] ?? null) !== $structureUid &&
$sectionRecord->structureId
) {
$structuresService->deleteStructureById($sectionRecord->structureId);
Expand Down

0 comments on commit ee9ac81

Please sign in to comment.