Generated with the help of an LLM.

Problem/Motivation

Whenever an inline block is removed from the site, it is never deleted from the database in the following situations:

  • When the block was on a non-revisionable entity, such as a user.
  • When an entity revision or translation is deleted.
  • When a Content Builder field is deleted.

Steps to reproduce

Non-revisionable entity:
  1. Add a "Content builder" field to users.
  2. Edit your account, add an inline "Basic block" and save.
  3. Remove the block and save again.
  4. The block is still in the database.
Entity revision:
  1. Add a "Content builder" field to the "Basic page" content type.
  2. Create a basic page with an inline "Basic block" and save it.
  3. Edit the page, remove the block and save it.
  4. On the Revisions tab, delete the first revision.
  5. The block is still in the database.
Entity translation:
  1. Install Content Translation, add a second language, and make basic pages and their "Content builder" field translatable.
  2. Create a basic page and save it.
  3. Translate it, add an inline "Basic block" to the translation and save it.
  4. Delete the translation.
  5. The block is still in the database.
Field (See #3637513: A deleted Content Builder field is never purged, so the module can't be uninstalled):
  1. Create a basic page with an inline "Basic block" and save it.
  2. Delete the "Content builder" field on Manage fields.
  3. Run cron until the field is purged.
  4. The block is still in the database.

No error is shown in any of these.

Proposed resolution

In each situation, delete the inline blocks that belong to the entity, and that no revision, translation or other Content Builder field of the entity still shows.

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

Comments

gloriaswebtech created an issue. See original summary.

gloriaswebtech’s picture

Issue summary: View changes
gloriaswebtech’s picture

Issue summary: View changes

  • gloriaswebtech committed 7e46e8eb on 1.0.x
    Issue #3637545 by gloriaswebtech: Delete a deleted field's inline blocks...

  • gloriaswebtech committed 20fda0e5 on 1.0.x
    Issue #3637545 by gloriaswebtech: Delete inline blocks nothing can show...
gloriaswebtech’s picture

Status: Active » Fixed

Fixed in 1.0.2

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.