Problem/Motivation

The default SwiperFormatter config entity can be deleted by navigating directly to /admin/config/content/swiper-formatter/default/delete. The user is presented with a confirmation form and can proceed to delete it.
This entity is critical to the module's functionality — it serves as the source of default values for newly created entities. Deleting it breaks entity creation and can cause fatal errors throughout the module.
There is currently no access restriction preventing deletion of the default entity.

Steps to reproduce

  1. Log in as a user with the administer swiper_formatter permission
  2. Navigate to /admin/config/content/swiper-formatter/default/delete
  3. Confirm the deletion
  4. The default entity is deleted and entity pages break

Proposed resolution

Implement a custom access handler that denies delete access for the default entity.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bbu23 created an issue. See original summary.

  • bbu23 committed d40aefb7 on 2.1.x
    test: #3574709 Add tests for default entity delete protection
    

  • bbu23 committed cc02c2e7 on 2.1.x
    fix: #3574709 Add access control handler to protect default...
bbu23’s picture

Assigned: bbu23 » Unassigned
Status: Active » Fixed

Will be available in 2.1.0

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.