Media Migration's text field process pipeline additions break non-HTML markup, such as Markdown

Created on 2 October 2023, over 1 year ago

Problem/Motivation

\Drupal\media_migration\MediaWysiwygPluginBase::process() injects additional steps into the process pipeline of body fields.

This conflicts when the body field does not contain HTML markup, but Markdown.

e.g. original input:

## Teamwork

These many hardened migrations are thanks to the titanic work of:

- Angie aka <https://www.drupal.org/u/webchick>
- Zoltan aka <https://www.drupal.org/u/huzooka>
- Gabe aka <https://www.drupal.org/u/gabesullice>
- Peter aka <https://www.drupal.org/u/zrpnr>
- Matthew aka <https://www.drupal.org/u/grasmash>
- Naren aka <https://www.drupal.org/u/narendrar>
- Srishti aka <https://www.drupal.org/u/srishtibankar>
- Omkar aka <https://www.drupal.org/u/omkarpodey>
- … and of course many in the Drupal community with whom we've collaborated along the way, especially <https://www.drupal.org/u/quietone>!

_If you found this interesting, check out [Gabe's write-up of the application architecture](https://dev.acquia.com/blog/tightly-integrated-loosely-coupled) that powers the awesome React-based UI that Peter built._

results in:

## Teamwork

These many hardened migrations are thanks to the titanic work of:

- Angie aka <https: www.drupal.org u webchick>
- Zoltan aka <https: www.drupal.org u huzooka>
- Gabe aka <https: www.drupal.org u gabesullice>
- Peter aka <https: www.drupal.org u zrpnr>
- Matthew aka <https: www.drupal.org u grasmash>
- Naren aka <https: www.drupal.org u narendrar>
- Srishti aka <https: www.drupal.org u srishtibankar>
- Omkar aka <https: www.drupal.org u omkarpodey>
- … and of course many in the Drupal community with whom we've collaborated along the way, especially <https: www.drupal.org u quietone>!

_If you found this interesting, check out [Gabe's write-up of the application architecture](https://dev.acquia.com/blog/tightly-integrated-loosely-coupled) that powers the awesome React-based UI that Peter built._</https:></https:></https:></https:></https:></https:></https:></https:></https:></https:></https:></https:></https:></https:></https:></https:></https:></https:></https:></https:></https:>

Steps to reproduce

Test this module with any body field that contains Markdown, or specifically the markup above.

Proposed resolution

TBD, but these seem options:

  1. Detect if any of the D9 equivalents of D7 filters is of the type TYPE_MARKUP_LANGUAGE, and if so, do NOT add some of these filters.
  2. Alternatively, detect if the source site even had the D7 filters installed, and only add them if they were present at all in the D7 filter table's name column.
  3. Something else still?

Work-around for now: either add an early return $migrations; to \Drupal\media_migration\MediaWysiwygPluginBase::process(), or modify the logic in either of the actually called process plugins that this is adding.

Remaining tasks

API changes

🐛 Bug report
Status

Active

Version

1.0

Component

Documentation

Created by

🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024