Skip to content

Instantly share code, notes, and snippets.

@steffenr
Created January 29, 2018 07:23
Show Gist options
  • Save steffenr/865692d54862bd75a3113fa8af059dd2 to your computer and use it in GitHub Desktop.
Save steffenr/865692d54862bd75a3113fa8af059dd2 to your computer and use it in GitHub Desktop.
[Drupal 8] Override id map with custom plugin for migrations
<?php
/**
* Implements hook_migration_plugins_alter().
*/
function my_module_migration_plugins_alter(array &$migrations) {
foreach ($migrations as $id => $configuration) {
if (!empty($migrations[$id]['idMap'])) {
// Do not override existing values.
continue;
}
// Override id map for each migration.
$migrations[$id]['idMap'] = [
'plugin' => 'sql_large_key',
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment