Install

Works with Drupal: ^10.2 || ^11

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 90.39 KB
MD5: 4f13b0d38bd268c812f35a7badfd9bd3
SHA-1: e5c58681f958775a22ff42720bb4bdc8ffe3b683
SHA-256: 1e84b3b3a8c03dabdaf40e422c03ade4b5d46bd612953bf060aad6935413c3ff
Download zip 152.14 KB
MD5: 99e70ef77d476227f4c15283228b6af9
SHA-1: d7303b5b0384da129580236cc96bb06990eeadef
SHA-256: 86b99a4cb6a184687e7e21f3ea9a6177b5e317d8bcae0746a29cd13deeb690b1

Release notes

This release contains significant performance improvements and code modernization.

Many thanks to @alexpott for working on the performance fixes that were pending, as well as finding and fixing new opportunities for making things faster and more efficient. πŸ‘πŸ™

Worth noting

1) The --use-queue flag in the drush entity-usage:recreate command is no longer supported. The queue behavior is incompatible with the new and more performant approach.

2) A few methods are being marked as deprecated and will be removed in a future version. Check #3341932: Entity Usage when a URL Redirect Exists for more details.

3) Many plugins were refactored to stop loading entities during the tracking operation in order to improve performance. By issuing direct queries to the DB instead of loading entities, performance is improved significantly. If you have tracking plugins in custom code, check the documentation on \Drupal\entity_usage\EntityUsageTrackInterface for tips on how to make your plugin as performant as the other ones that are shipped with the module.

Upgrading from older releases

In this release we remove old hook implementations from entity_usage.install, in order to simplify maintenance. If you are using a version older than 8.x-2.0-beta9, then you should update to 8.x-2.0-beta17 first, and then in a subsequent deployment update to this (or any release older than -beta18).

Contributors (8)

alexpott, dahousecat, dhruv.mittal, donquixote, marcoscano, osman, plopesc, silvi.addweb

Changelog

Issues: 21 issues resolved.

Changes since 8.x-2.0-beta17:

Bug

  • #3503961 by alexpott, dahousecat, marcoscano: Entity tracking can cause exceptions and prevent entities being saved
  • #3260251 by dhruv.mittal, osman, alexpott, donquixote, marcoscano: Error: Call to private method in entity_usage_form_alter()

Feature

  • #3475721 by marcoscano, plopesc: Improve redirect logic for usage links in warning messages

Task

  • #3499648 by alexpott, marcoscano: Fix PHPStan and make code quality checks fail
  • #3499590 by alexpott, marcoscano: Add the ability to bulk insert to EntityUsage service
  • #3501421: Improve performance of EntityReference entity usage tracking plugin
  • #3501466 by alexpott, marcoscano: Improve performance of \Drupal\entity_usage\Plugin\EntityUsage\Track\TextFieldEmbedBase::getTargetEntities()
  • #3501750 by marcoscano: Fix cspell and eslint checks
  • #3502706 by alexpott, marcoscano: Tidy up spelling and fail if we break it
  • #3502733 by alexpott, marcoscano: Delete records using \Drupal\entity_usage\EntityUsageInterface::bulkDeleteSources() is slow
  • #3503070 by alexpott, marcoscano: Massively improve batch performance by reducing the number of queries
  • #3501655 by alexpott: Bulk insert into a different table
  • #3502795: Stop loading entities when we do not need to
  • #3503687 by alexpott, marcoscano: Entity reference tracking is still loading the entity
  • #3503296 by alexpott, marcoscano: Remove the queue option from the rebuild entity usage command
  • #3503696: Remove entity loading from \Drupal\entity_usage\Plugin\EntityUsage\Track\BlockField and use entity queries instead
  • #3503697 by alexpott, marcoscano: Remove entity loading from \Drupal\entity_usage\Plugin\EntityUsage\Track\LayoutBuilder and use entity queries instead
  • #3503805 by alexpott: Add documentation to \Drupal\entity_usage\EntityUsageTrackInterface about performance
  • #3505180 by alexpott: Increase PHPStan level to improve code quality and testing on changes
  • #3341932: Entity Usage when a URL Redirect Exists
  • #3505658: Increase PHPStan level even more
Created by: marcoscano
Created on: 15 Feb 2025 at 17:22 UTC
Last updated: 17 Jun 2025 at 14:47 UTC
Bug fixes
New features

Other releases