Skip to content

Commit

Permalink
IBX-6738: Fixed content type group deletion when it contains orphaned…
Browse files Browse the repository at this point in the history
… content type drafts
  • Loading branch information
adamwojs committed Oct 23, 2023
1 parent be30e09 commit 7f51e57
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/Repository/ContentTypeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,11 @@ public function deleteContentTypeGroup(APIContentTypeGroup $contentTypeGroup): v

$this->repository->beginTransaction();
try {
$ContentTypesDrafts = $this->contentTypeHandler->loadContentTypes($contentTypeGroup->id, SPIContentType::STATUS_DRAFT);
foreach ($ContentTypesDrafts as $contentTypeDraft) {
$this->contentTypeHandler->delete($contentTypeDraft->id, SPIContentType::STATUS_DRAFT);
}

$this->contentTypeHandler->deleteGroup(
$loadedContentTypeGroup->id
);
Expand Down

0 comments on commit 7f51e57

Please sign in to comment.