Skip to content

[4.x]: Unable to delete Sections or Entry Types #16982

Closed
@lindseydiloreto

Description

@lindseydiloreto

What happened?

Description

It seems to be impossible to delete sections and entry types in Craft 4.

By the looks of it, the ‎Sections::deleteEntryType method isn't actually deleting anything...

cms/src/services/Sections.php

Lines 1323 to 1334 in 5d6f656

public function deleteEntryType(EntryType $entryType): bool
{
// Fire a 'beforeDeleteEntryType' event
if ($this->hasEventHandlers(self::EVENT_BEFORE_DELETE_ENTRY_TYPE)) {
$this->trigger(self::EVENT_BEFORE_DELETE_ENTRY_TYPE, new EntryTypeEvent([
'entryType' => $entryType,
]));
}
Craft::$app->getProjectConfig()->remove(ProjectConfig::PATH_ENTRY_TYPES . '.' . $entryType->uid, "Delete the “{$entryType->handle}” entry type");
return true;
}

Steps to reproduce

  1. In Craft 4, create a section and/or entry type.
  2. Try to delete that section and/or entry type.
  3. Refresh the page to see that it still exists!

Expected behavior

Deleting a section/entry type should delete the section/entry type.

Actual behavior

Deleting a section/entry type does not delete the section/entry type.

Craft CMS version

4.14.11.1

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions