Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292921

Handle long comment bundle names

$
0
0

Problem/Motivation

CR Entity type and bundle machine names have a maximum length of 32 characters

Running a migration from a Drupal 7 test site where I have migrate_example enabled, I got a bunch of errors from d7_comment_type like:

Attempt to create a bundle with an ID longer than 32 characters: comment_node_migrate_example_beer().
(/Users/mryan/Sites/d8/core/lib/Drupal/Core/Entity/Entity.php:384)

In the D7 field_config_instance table, for example, the bundle corresponding to field_name comment_body and entity_type comment may be comment_node_migrate_example_beer - more than the 32 character limit for bundle names in D8. We might simply truncate them at 32 (comment_node_migrate_example_bee in this example), and that will work for these particular bundles, but there may be other cases out there with similar common prefixing that won't uniquely truncate at 32, so we might want to add some intelligence to it...

Proposed resolution

Use the make_unique_entity_field process plugin for the d6 and d7 comment type migrations. The d7_field_instance migration uses a new process plugin. field_bundle, to determine the bundle name and the d7_field_formatter_settings and d7_field_instance_widget_settings are altered to get the bundle on a migration_lookup for d7_field_instance.

Remaining tasks

  • Patch
  • Review
  • Commit

Viewing all articles
Browse latest Browse all 292921

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>