Improved the exception message in d6/FieldTypeDefaults

Created on 29 November 2016, about 8 years ago
Updated 16 August 2023, over 1 year ago

Problem/Motivation

Running the d6_field_formatter_settings migration, with multiples fields type (text, link, date), only date are "created". Other are "failed".
The message logged is, for example:

Failed to lookup field type array (
  0 => 'link',
  1 => 'default',
) in the static map.

After a long investigation I found that this is due to /core/modules/field/src/Plugin/migrate/process/d6/FieldTypeDefaults.php
Although it does trigger a MigrateException (= message), IMHO it misses a more explicit explanation like:

text/link/xxx field migration does not provide yet support migrating default-value

(+ using ignored rather than failed).
That would avoid one to think that the migration somehow failed.

Also, the code does not explains why it only migrate "date" default value and not the other field types.

Proposed resolution

Change the MigrateException message in d6/FieldTypeDefaults process plugin from
Failed to lookup field type %s in the static map.
to
No default field type found for field type %s

Remaining tasks

Review
Commit

Feature request
Status

Needs work

Version

11.0 🔥

Component
Migration 

Last updated about 8 hours ago

Created by

🇫🇷France drzraf

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