Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

Notes

  • This module should not be run on a production environment.
  • Backup the database of any system you are going to run this on before running it.
  • The module deletes content created in Layout Builder it considers orphaned. There is no rollback.
  • The module uses the inline block usage service (getUsage) to determine if a block is orphaned or not. As documentation on this service is limited you should confirm it is doing what you expect before using it.

Description

When a page is built using layout builder and a custom block is added, "Create Custom Block", a block of type 'non reusable' or 'inline' is created.

These blocks 'belong' only to the Layout they are added to and can't be used anywhere else unlike normal blocks.

At some points in the past development of Layout Builder and possibly still now while developing it was/is possible for these blocks to be orphaned. The original page/layout can have been deleted/removed but the non reusable custom blocks still exist in the system.

The primary issue with orphaned blocks is that if you have modules supplying those custom blocks and you try to remove/reinstall them you will get errors from the system telling you that you still have content and your module can't be removed.

There is no way in the Drupal system to see these blocks or remove them so you are stuck.

This is what this module helps with. It searches the system for non reusable blocks and checks to see if they are still in use.

If a non reusable block is found to be orphaned and no longer referenced by anything then it is deleted.

Usage

  • Install the module as any other D8+ module using composer.
  • Enable the module and clear cache and then navigate to Admin->Content authoring->Delete Orphaned Block Content.
  • The module will search for orphaned blocks and if any found ask if you want to delete them (all or nothing at the moment).
  • If you wish to continue and delete the orphaned blocks click 'Delete orphans'
  • You will be asked to confirm and if you do the orphaned blocks will be deleted.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Feb 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
1.0.2 Stable Feb 9, 2024