This module allows the comparison, detection and restriction of duplicate media
entities within a site.

Cleaning up the duplicate media items is currently outside the scope of this module. That's because it's a hard task. Depending on media usage in fields, usage across translations, usage in token embedded media, usage in config (blocks, etc).

Installation

  • To install this module, composer require it, or place it in your modules folder and enable the module.
  • Generate initial checksums if you have existing media items. You can use the form linked from the status page or run the drush media-duplicates:checksums:rebuild command. (Currently only supports Drush 9+)

Usage

  • Install this module as early as possible in your development process to reduce any technical debt you later have to clean up.
  • Module allows progressive enhancement by having settings that
    • Allow you to generate a report but don't restrict duplicates.
    • Restrict new duplicates but still allow you to save existing.
    • Restrict all duplicates, both new and existing.
  • Use in conjunction with Entity Usage to help find where duplicates are used and consolidate.

Plugin architecture

This module allows media type developers to implement a MediaDuplicatesChecksum plugin to integrate with this module.

Alternatives

Supporting organizations: 
proudly helps to maintain this module for the Drupal community

Project information

Releases