Problem/Motivation

The Link field migration plugin system currently does not map all the field formatters from D7 to D8/D9.

Proposed resolution

D7 has these field formatters `link_default`, `link_title_plain`, `link_host`, `link_url`, `link_plain`, `link_absolute`, `link_domain`, `link_no_protocol`, `link_short`, `link_label` and `link_separate`. Out of which mapping of only `link_default` is done. Resolution is to map all Link module's field formatters from D7 to D8/D9.

Remaining tasks

Patch
Review
Commit

Comments

n4r3n created an issue. See original summary.

n4r3n’s picture

StatusFileSize
new801 bytes

This patch provides link module's field formatter mapping.

n4r3n’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: 3212539-link-field-formatter-mapping-2.patch, failed testing. View results

quietone’s picture

Component: link.module » migration system

@n4r3n, are these formatters in Drupal 7 core or are they supplied by contrib?

wim leers’s picture

Thanks for starting this issue & patch, @n4r3n! 🙏

@n4r3n, are these formatters in Drupal 7 core or are they supplied by contrib?

They're in D7 contrib, but for a module that was moved into core: the Link module: https://git.drupalcode.org/project/link/-/blob/7.x-1.x/link.module#L1210. For all other contrib-modules-providing-field-types-that-now-live-in-Drupal-8-core cases, we've specified the mapping in core. So I think we should do the same here.

@n4r3n Looks like you'll need to update the expectations in \Drupal\Tests\migrate_drupal\Kernel\d7\FieldDiscoveryTest::addAllFieldProcessesAltersData() — once you do that tests should pass! 😊👍

n4r3n’s picture

Thank you for reviewing it, here is the patch with updated test case.

wim leers’s picture

That looks great! Will manually test in the morning 🤓

wim leers’s picture

Status: Needs work » Reviewed & tested by the community

Manually tested, works beautifully! 👏

This does not migrate the field formatter settings, but that is also not the case for the pre-existing link_default formatter (its custom_title setting is not migrated).

Therefore: this is a net improvement for everyone — migrating the formatter settings is out of scope here. Because doing that would require not just adding it for these new mappings, but also for the pre-existing link_default mapping.

  • catch committed 5c952d4 on 9.3.x
    Issue #3212539 by n4r3n, Wim Leers: Map all Link module's...

  • catch committed 4b40396 on 9.2.x
    Issue #3212539 by n4r3n, Wim Leers: Map all Link module's...
catch’s picture

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

Committed/pushed to 9.3.x and cherry-picked to 9.2.x and 9.1.x, thanks!

  • catch committed 03355b6 on 9.1.x
    Issue #3212539 by n4r3n, Wim Leers: Map all Link module's...
quietone’s picture

Status: Fixed » Closed (fixed)

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