Skip to content

CKEditor deletion blocker references aren't cleaned up when drafts become applied #600

@mmikkel

Description

@mmikkel

Description

I noticed that the references count in the deletion blocker for an entry I was deleting, was suspiciously high.

Image

There is only a single element (entry) with a CKEditor link to the "I am an entry" entry, so the count is obviously wrong. And as far as I can tell, the count actually keeps increasing every time I apply a draft for the entry that owns the link.

Steps to reproduce

  1. Create two entries, "Entry A" and "Entry B". In "Entry A", link to "Entry B" in a CKEditor field. Fully save "Entry A".
  2. Trigger the deletion blocker for "Entry B". Make a note of the references count in the "The entry is referenced by CKEditor fields in X other elements." message.
  3. Go back to the edit page for "Entry A", and make a change (don't remove the link). Let the auto-save complete; then click Save to apply the provisional draft.
  4. Trigger the deletion blocker for "Entry B" again. Confirm that the references count has now increased.

Additional info

  • Craft version: 5.10.7
  • PHP version: 8.2
  • Database driver & version:
  • Plugins & versions: CKEditor 5.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions