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.
Comment | File | Size | Author |
---|---|---|---|
Fatal PHP error in Migrate module due to empty dependancy.patch | 2.05 KB | Scott Robertson |
Comments
Comment #1
joelpittetThis works when the default is WebformNode, thanks for the fixes