Problem/Motivation

Followup to #1709960: declare a maximum length for entity and bundle machine names.

In Drupal 8, entity and bundle machine names are limited to 32 characters

Propos ed resolution

We have two options

  1. Automatically cut entity and bundle machine names at 32 characters.
  2. Allow users to rename entities and bundle machine names that exceed the 32 character limit during the migration process.

Assigning to moshe initially just to make sure he has this issue in his queue.

User interface changes

Maybe some new UI in the migrate_drupal module

API changes

None.

Original report by @jessebeach

Comments

moshe weitzman’s picture

Assigned: moshe weitzman » Unassigned

The migration team will sort this. I vote for automatic truncate, with uniqueness preserved. So if we run into articles and articles_red and we have to truncate we do articl and articl1. We run into this in Migrate a lot.

jessebeach’s picture

Title: Restrict entity ID and bundle » Restrict entity ID and bundle machine name string length to 32 characters
Berdir’s picture

Note that this is *not* trivial, this isn't the usual one-off specific truncation.

Changing a bundle during migration will affect a whole bunch of other migrations as well, you need to consider this for fields, displays, language configuration, menu settings of a node type, basically everything that is based on the bundle.

And the entity_type ID (not sure if you mean entity type or entity ID) can't be truncated automatically, because this then depends on what the module providing that entity type did in its 8.x version.

bdone’s picture

while not knowing about this issue (until today), i've attempted a patch in #2247903: Add a substr options to DedupeBase process plugin, to try and add a substring option to the MachineName process plugin. maybe that is one possible solution?

bdone’s picture

it's not automatic, but there is some more possible progress happening towards this in #2247903: Add a substr options to DedupeBase process plugin.

bdone’s picture

Status: Active » Closed (duplicate)

#2247903: Add a substr options to DedupeBase process plugin has been committed. i'm not 100% sure, but i think this is a now a duplicate. please re-open if that's not correct, or more is needed here.

Berdir’s picture

Are we actually using it for the relevant migrations or did issue just add the plugin?

bdone’s picture

@Berdir, that issue only affected existing d6->d8 migrations that were already using the dedupe process plugin. this list was:

  • d6_block
  • d6_contact_category
  • d6_filter_format
  • d6_taxonomy_vocabulary
  • d6_user_role

are more needed?

Berdir’s picture

Good question not sure.

It's not a problem for D6 but for D7 migrations, with fields on terms that have the vocabulary as bundle will need to be dealt with accordingly, so we need to make sure that the bundle in the instance configuration is cut in the same way as the one in the vocabulary migration.