URLs without http:// are broken after migration from d6 or d7

Created on 25 July 2017, over 7 years ago
Updated 11 September 2023, over 1 year ago

Problem/Motivation

  • Process plugin d6_field_link is used to migrate the content of Link fields from an older version of Drupal. This same process plugin is used also with D7-D8 migrations since the d7 link_field plugin extends d6.
  • The migration works correctly if the source URL is a full absolute URL with a protocol prefix (e.g. http://).
  • In Drupal 6/7, the Link fields also accept an URL without the protocol prefix, in other words a Link field with URL value www.example.com will work in Drupal 7. When this value is migrated to Drupal 8, the link is broken because Drupal 8 Link field expects the URL value to be a full absolute URL or a relative URL to the Drupal site itself.

Proposed resolution

To avoid breaking links that were working Drupal 7, add the following logic to d6_field_link process plugin:

  • If the URL starts with "www.", add a "http://" prefix

Remaining tasks



Review
Commit

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

8.4 ⚰️

Component
Migration 

Last updated about 3 hours ago

Created by

🇫🇮Finland masipila

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024