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

CommentFileSizeAuthor
#21 2831531-21.patch1.64 KBquietone

Comments

drzraf created an issue. See original summary.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

joelpittet’s picture

I'm still trying to figure out what it expects and where to fix this. I agree with the issue summary, the very least would be to provide more information in the exception.

joelpittet’s picture

Issue tags: +migrate-d6-d8
heddn’s picture

Title: FieldTypeDefaults.php fiields migration ignored without an explicit message » FieldTypeDefaults fields migration ignored without an explicit message

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

heddn’s picture

Could use some tests and a patch.

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

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

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.

quietone’s picture

Issue summary: View changes

So, the recommendation here is to improve the message thrown in d6/FieldTypeDfaults to assist fixing the problem.

throw new MigrateException(sprintf('Failed to lookup field type %s in the static map.', var_export($value, TRUE)))

The suggestion is "text/link/xxx field migration does not provide yet support migrating default-value". Since there are many field migrations (field, field_instance etc) using that phrase won't be clear. How about this:

No default value available for destination property '%s' for field type '%s'

Opinions?

quietone’s picture

If #2976098: MigrateExecutable should add details for the migration & destination property to exceptions that cause a row failure is committed then the message will include the migration and the destination property. With the migration and destination property it is a simple task to look at the relevant process. In this case it is a static_map with a long list of mappings. The next question then is what value caused the exception. And we have that information, it is provided in the existing exception message. So, now it should be a straightforward fix to add the missing mapping.

Given that I think this is probably a won't fix.

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

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.64 KB

d6_field_formatter_settings:options/type:d6_field_type_defaults: No default type found for field type 'text_default'

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Error message matches the proposed solution and seems to give the additional information needed.

quietone’s picture

Title: FieldTypeDefaults fields migration ignored without an explicit message » Improved the exception message in d6/FieldTypeDefaults
Issue summary: View changes

Just improving the Issue Summary and title.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 21: 2831531-21.patch, failed testing. View results

quietone’s picture

Status: Needs work » Postponed

The Migrate Drupal Module was approved for removal in #3371229: [Policy] Migrate Drupal and Migrate Drupal UI after Drupal 7 EOL.

This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

The deprecation work is in #3522602: [meta] Tasks to remove Migrate Drupal module and the removal work in #3522602: [meta] Tasks to remove Migrate Drupal module.

Migrate Drupal will not be moved to a contributed project. It will be removed from core after the Drupal 12.x branch is open.

quietone’s picture

Status: Postponed » Closed (won't fix)

The Migrate Drupal and Migrate Drupal UI modules are deprecated and will be removed from Drupal 12. For these modules, effort is now focused on bug fixes and necessary tasks. Therefore, this feature request is closed as won't fix.

Thanks to all for working on this!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.