-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocation_migration.module
41 lines (37 loc) · 1.31 KB
/
location_migration.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* @file
* Functions and hooks of Location Migration.
*/
use Drupal\location_migration\MigrationPluginAlterer;
use Drupal\location_migration\Plugin\migrate\field\Location;
/**
* Implements hook_migration_plugins_alter().
*/
function location_migration_migration_plugins_alter(array &$definitions) {
MigrationPluginAlterer::alterMigrationPlugins($definitions);
}
/**
* Implements hook_migrate_field_info_alter().
*/
function location_migration_migrate_field_info_alter(&$definitions) {
// Geolocation has added a location field migrate plugin in
// https://drupal.org/i/3174059 which migrates Drupal 7 location fields to
// geolocation fields.
// Location Migration provides a more complete data migration, so if this
// module is enabled, we need to set this plugin definition back to our
// implementation.
if (
!empty($definitions['location']) &&
$definitions['location']['type_map']['location'] !== 'address'
) {
$definitions['location']['type_map'] = [
'location' => 'address',
];
$definitions['location']['core'] = [7];
$definitions['location']['source_module'] = 'location_cck';
$definitions['location']['destination_module'] = 'address';
$definitions['location']['class'] = Location::class;
$definitions['location']['provider'] = 'location_migration';
}
}