When "Create a node migration by default" is checked, a PHP fatal error can be triggered under various circumstances, including trying to view the Webform Migration group (admin/content/migrate/groups/webform):

PHP Fatal error: Call to a member function getGroup() on null in migrate.module on line 98

This due to the fact that the WebFormSettings migration has a blank dependency added to it. The implementation of hook_migrate_api sets some common arguments at the top:

$common_arguments = array(
    'source_connection' => variable_get('migrate_webform_source_database', 'default'),
    'source_version'=> substr(variable_get('migrate_webform_source_database_api_version', 'd6'), 1, 1),
    'group_name' => 'webform',
    'format_mappings' => array(
      '1' => 'filtered_html',
    ),
    'node_migrations' => explode(' ', variable_get('migrate_webform_node_migration_class', "WebformNode")),
  );

The 'node_migrations' key assignment is the issue, as the 'migrate_webform_node_migration_class' is blank when a node migration is being created by the module itself. The dependency is set further down, but $common_arguments['node_migrations'] is now an array containing an empty string:

$settings_arguments = $common_arguments + array(
    'class_name' => 'WebformSettings',
    'machine_name' => 'WebformSettings',
    'description' => t('Migration of settings for webforms from Drupal 6'),
    'dependencies' => $common_arguments['node_migrations'],
);

Attached is a patch that fixes this issue.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joelpittet’s picture

+++ b/migrate_webform.migrate.inc
@@ -15,6 +15,8 @@ function migrate_webform_migrate_api() {
+  $node_migration_class = variable_get('migrate_webform_node_migration_class', '');

@@ -22,7 +24,7 @@ function migrate_webform_migrate_api() {
-    'node_migrations' => explode(' ', variable_get('migrate_webform_node_migration_class', "WebformNode")),
+    'node_migrations' => !empty($node_migration_class) ? explode(' ', $node_migration_class) : array(),

This works when the default is WebformNode, thanks for the fixes