Skip to content

Compatibility

media_directories_compat is a migration helper. Enable it on sites that previously embedded media using the entity_embed module and want existing content to keep rendering after switching to core's media_embed filter. It rewrites legacy <drupal-entity> markup to <drupal-media> at render time, so you don't have to bulk-update every existing field value.

The submodule has no admin UI and no configuration. The conversion runs as part of the filter pipeline.

When you need this

  • Your site was on entity_embed for media embeds.
  • You're moving to Media Directories (or to core's media embed in general).
  • Existing field values contain <drupal-entity data-entity-type="media" …> tags that you don't want to migrate by hand.

If your content was created on a site that already used <drupal-media> — which is the case for most fresh installs — you don't need this submodule.

Install

drush en media_directories_compat

Dependencies: media_directories, core media. No dependency on media_directories_browser, so you can use it standalone during a migration without committing to the Vue.js browser.

Additional setup

None. As long as the text format used to render the legacy content has Embed media enabled, legacy <drupal-entity> tags pointing at media entities will be converted to <drupal-media> markup transparently.

When the migration is complete and you've fully cut over to <drupal-media> markup — either by saving content through the new editor or by running a one-time migration — you can disable the submodule.

Verifying the install

  • View a piece of pre-existing content that still contains <drupal-entity data-entity-type="media" …> markup. The rendered output shows the same media as before — but viewing the raw HTML reveals <drupal-media> tags instead of <drupal-entity> ones.