Problem/Motivation

The Editor module provides two filter plugins that were backported from Drupal 8: editor_align and editor_caption.

This two filters are operating with the same control attributes (data-align and data-caption, respectively) as their Drupal 8 equivalents (filter_align and filter_caption), so they can be easily mapped to a valid filter plugin during Drupal 7 -> Drupal 8 migrations.

Proposed resolution

Provide mapping for these two filters:

  • Map editor_align to filter_align
  • Map editor_caption to filter_caption

Remaining tasks

* Patch.
* Test (?).

User interface changes

Nothing.

API changes

Nothing.

Data model changes

The editor_align and editor_caption filters are mapped to their corresponding Drupal 8 filters.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

huzooka created an issue. See original summary.

huzooka’s picture

huzooka’s picture

Assigned: huzooka » Unassigned
Status: Active » Needs review
Wim Leers’s picture

Great, thanks!

+++ b/core/modules/filter/migrations/d7_filter_format.yml
@@ -26,7 +26,9 @@ process:
         # No need to map anything -- filter plugin IDs haven't changed since
         # Drupal 7.

Nit: this comment was referring to D7 core filters: they indeed did not change in D8.

The comment now needs to be expanded, to reflect that some D7 contrib filters now are part of D8 core. Hence D8 core needs to provide an upgrade path for those contrib filters.

huzooka’s picture

Assigned: Unassigned » huzooka
Status: Needs review » Needs work
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
FileSize
943 bytes
849 bytes
huzooka’s picture

@Wim Leers, thanks!

Wim Leers’s picture

Thanks!

Two more language nits:

+++ b/core/modules/filter/migrations/d7_filter_format.yml
@@ -24,9 +24,13 @@ process:
+        # the contrib filters of the Editor module – those are the backport some
  1. "those are the backport some of the new ones in Drupal 8".

    "those are the Drupal 7 backport of some of the new filters in Drupal 8 core."
  2. "Hence D8 core can provide"

    "Hence Drupal 8 core is responsible for providing"

After that, this is RTBC 🥳

Wim Leers’s picture

Status: Needs review » Needs work
huzooka’s picture

Assigned: Unassigned » huzooka
huzooka’s picture

huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

As the de facto maintainer of filter module, the official maintainer of editor module and the primary author of the D7/D8 filters involved in this patch, I think this is RTBC.

Wim Leers’s picture

Status: Reviewed & tested by the community » Needs review

(FWIW: test coverage here in \Drupal\Tests\filter\Kernel\Migrate\d7\MigrateFilterFormatTest::testFilterFormat() could be added, but it would not really add anything. We'd just be testing that the \Drupal\migrate\Plugin\migrate\process\StaticMap process plugin is working as designed.)

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

Oops!

quietone’s picture

Has this has any manual testing?

Wim Leers’s picture

Has this has any manual testing?

Sorry, should have called that out.

Yes, it has been manually tested. I just did so again just to prove it:

D7 data
D8 result before patch
D8 result after patch

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

  • catch committed e52b80a on 8.9.x
    Issue #3106304 by huzooka, Wim Leers: Migrate: add mapping for editor...

  • catch committed 32e8272 on 9.0.x
    Issue #3106304 by huzooka, Wim Leers: Migrate: add mapping for editor...
catch’s picture

Version: 9.1.x-dev » 8.9.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 9.1.x and cherry-picked back to 8.9.x, thanks!

  • catch committed 683ed03 on 9.1.x
    Issue #3106304 by huzooka, Wim Leers: Migrate: add mapping for editor...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.