Problem/Motivation
The filter_format_permission process plugin hard codes the migration lookup name. This should be configurable, similar to #2640842: Make related file migration ID configurable in d6_cck_file.
Proposed resolution
Make the configuration configurable.
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) {
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$migration,
$container->get('plugin.manager.migrate.process')->createInstance('migration', ['migration' => 'd6_filter_format'], $migration)
);
}
Remaining tasks
code it.review it.- update/add change record
User interface changes
n/a
API changes
n/a
Data model changes
Original report
I get the following error when trying to import users
InvalidArgumentException: Passed variable is not an array or object, using empty array instead in /var/www/docroot/core/modules/migrate/src/Plugin/migrate/process/Flatten.php:30
Stack trace:
#0 /var/www/docroot/core/modules/migrate/src/Plugin/migrate/process/Flatten.php(30): ArrayIterator->__construct(NULL)
#1 /var/www/docroot/core/modules/migrate/src/MigrateExecutable.php(395): Drupal\migrate\Plugin\migrate\process\Flatten->transform(NULL, Object(Drupal\migrate_tools\MigrateExecutable), Object(Drupal\migrate\Row), 'permissions')
#2 /var/www/docroot/core/modules/migrate/src/Plugin/migrate/process/Migration.php(139): Drupal\migrate\MigrateExecutable->processRow(Object(Drupal\migrate\Row), Array)
#3 /var/www/docroot/core/modules/migrate/src/MigrateExecutable.php(381): Drupal\migrate\Plugin\migrate\process\Migration->transform(Array, Object(Drupal\migrate_tools\MigrateExecutable), Object(Drupal\migrate\Row), 'roles')
#4 /var/www/docroot/core/modules/migrate/src/MigrateExecutable.php(218): Drupal\migrate\MigrateExecutable->processRow(Object(Drupal\migrate\Row))
#5 /usr/local/share/drush/includes/drush.inc(720): Drupal\migrate\MigrateExecutable->import()
#6 /usr/local/share/drush/includes/drush.inc(711): drush_call_user_func_array(Array, Array)
#7 /var/www/docroot/modules/contrib/migrate_tools/migrate_tools.drush.inc(280): drush_op(Array)
#8 [internal function]: _drush_migrate_tools_execute_migration(Object(Drupal\migrate\Plugin\Migration), 'awm_users', Array)
#9 /var/www/docroot/modules/contrib/migrate_tools/migrate_tools.drush.inc(246): array_walk(Array, '_drush_migrate_...', Array)
#10 /usr/local/share/drush/includes/command.inc(422): drush_migrate_tools_migrate_import('awm_users')
#11 /usr/local/share/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#12 /usr/local/share/drush/includes/command.inc(199): drush_command('awm_users')
#13 /usr/local/share/drush/lib/Drush/Boot/BaseBoot.php(73): drush_dispatch(Array)
#14 /usr/local/share/drush/includes/preflight.inc(93): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#15 /usr/local/share/drush/drush.php(11): drush_main()
#16 {main}
I've generated this from the migrate-update --config-only drush command
langcode: en
status: true
dependencies: { }
id: awm_users
migration_tags:
- 'Drupal 7'
migration_group: migrate_drupal_7
label: 'User accounts'
source:
plugin: d7_user
process:
uid: uid
name: name
pass: pass
mail: mail
created: created
access: access
login: login
status: status
timezone: timezone
langcode:
plugin: user_langcode
source: language
fallback_to_site_default: false
preferred_langcode:
plugin: user_langcode
source: language
fallback_to_site_default: true
preferred_admin_langcode:
plugin: user_langcode
source: language
fallback_to_site_default: true
init: init
roles:
plugin: migration
migration: awm_users_role
source: roles
user_picture:
-
plugin: default_value
source: picture
default_value: null
-
plugin: migration
migration: upgrade_d7_file
destination:
plugin: 'entity:user'
migration_dependencies:
required:
- awm_users_role
optional:
- upgrade_d7_file
- upgrade_language
- upgrade_default_language
- upgrade_user_picture_field_instance
- upgrade_user_picture_entity_display
- upgrade_user_picture_entity_form_display
- upgrade_d7_field_instance
- upgrade_d7_user_role
Using Drupal 8.2.5. awm_users_role migrated ok.
Tbh I have no idea which of the 9 additional migration modules this would fall under. I'm trying to do a selective migration from drupal 7 to 8, so generating the migration templates through drush, and then running migrate-import.