diff --git a/config/sync/migrate_plus.migration.va_node_facility_vet_centers_os.yml b/config/sync/migrate_plus.migration.va_node_facility_vet_centers_os.yml index 3f34ae9c763..5f49e070b08 100644 --- a/config/sync/migrate_plus.migration.va_node_facility_vet_centers_os.yml +++ b/config/sync/migrate_plus.migration.va_node_facility_vet_centers_os.yml @@ -100,7 +100,7 @@ process: method: row value: - OS - title: + field_official_name: plugin: skip_on_empty method: row source: name @@ -236,13 +236,13 @@ destination: - field_geolocation - field_phone_number - field_office_hours + - field_official_name - field_timezone - new_revision - revision_default - revision_log - revision_timestamp - revision_uid - - title - uid migration_dependencies: required: { } diff --git a/docroot/modules/custom/va_gov_migrate/config/install/migrate_plus.migration.va_node_facility_vet_centers_os.yml b/docroot/modules/custom/va_gov_migrate/config/install/migrate_plus.migration.va_node_facility_vet_centers_os.yml index 064208312be..ecfe799e337 100644 --- a/docroot/modules/custom/va_gov_migrate/config/install/migrate_plus.migration.va_node_facility_vet_centers_os.yml +++ b/docroot/modules/custom/va_gov_migrate/config/install/migrate_plus.migration.va_node_facility_vet_centers_os.yml @@ -108,7 +108,7 @@ process: method: row value: - OS - title: + field_official_name: plugin: skip_on_empty method: row source: name @@ -251,13 +251,13 @@ destination: - 'field_geolocation' - field_phone_number - field_office_hours + - field_official_name - field_timezone - new_revision - revision_default - revision_log - revision_timestamp - revision_uid - - title - uid # Dependency on other migrations. migration_dependencies: diff --git a/docroot/modules/custom/va_gov_migrate/va_gov_migrate.module b/docroot/modules/custom/va_gov_migrate/va_gov_migrate.module index fe36d380e94..0aab4b06169 100644 --- a/docroot/modules/custom/va_gov_migrate/va_gov_migrate.module +++ b/docroot/modules/custom/va_gov_migrate/va_gov_migrate.module @@ -54,18 +54,19 @@ function _va_gov_migrate_process_va_form(EntityInterface &$entity) { } /** - * Set default Vet Center title. + * Set default Vet Center or Vet Center - Outstation title. * * @param \Drupal\Core\Entity\EntityInterface $entity * Entity. */ function _va_gov_migrate_set_default_vet_center_title(EntityInterface &$entity) { - if ($entity->bundle() !== 'vet_center' || (!$entity instanceof NodeInterface)) { + $bundles = ['vet_center', 'vet_center_outstation']; + if (!in_array($entity->bundle(), $bundles) || (!$entity instanceof NodeInterface)) { return; } /** @var \Drupal\node\NodeInterface $entity */ - // If a Vet Center title is empty copy the value from field_official_name. + // If a title is empty, copy the value from field_official_name. if (empty($entity->getTitle())) { $default_title = $entity->get('field_official_name')->value ?: '- none -'; $entity->setTitle($default_title);