profile member almost done, missing email

This commit is contained in:
Bachir Soussi Chiadmi 2019-02-09 20:47:36 +01:00
parent 5816142342
commit beee434e21
2 changed files with 45 additions and 23 deletions

View File

@ -31,33 +31,12 @@ process:
plugin: migration_lookup
migration: d7_users
source: uid
field_activity_sector: field_activity_sector
field_employee: field_employee
field_title: field_private_name_title
field_first_name: field_first_name
field_name: field_name
field_naf: field_naf
field_organization: field_organization
field_activity_sector: field_activity_sector
field_phone: field_private_phone
field_position: field_private_quality
field_service: field_service
field_siret: field_siret
field_title: field_private_name_title
field_vat_number_intra_ce: field_vat_number_intra_ce
field_website: field_user_website
field_memo: field_memo
# field_email:
# plugin: merge
# source:
# - field_administrative_email
# - field_private_email
# field_name:
# plugin: merge
# source:
# - field_name
# - field_private_name
# field_address:
# plugin: addressfield
@ -87,6 +66,37 @@ process:
# name_line
# data
field_position: field_private_quality
field_service: field_service
field_employee: field_employee
field_vat_number_intra_ce: field_vat_number_intra_ce
field_naf: field_naf
field_siret: field_siret
field_website:
plugin: iterator
source: field_user_website
process:
uri: url
title: title
options: attributes
# not verified
field_email: field_email
# field_email
# plugin: merge
# source:
# - field_administrative_email
# - field_private_email
# field_name:
# plugin: merge
# source:
# - field_name
# - field_private_name
migration_dependencies:
required:
- d7_users

View File

@ -105,6 +105,18 @@ class D7UserProfile extends FieldableEntity {
$row->setSourceProperty($field_name, $this->getFieldValues('profile2', $field_name, $pid));
}
// merge : field_administrative_email & field_private_email into field_email
// merge : field_private_name & field_name into field_name
switch ($type) {
case 'contact_operationnel':
$row->setSourceProperty('field_email', $row->getSourceProperty('field_administrative_email'));
$row->setSourceProperty('field_name', $row->getSourceProperty('field_private_name'));
break;
case 'adherent':
$row->setSourceProperty('field_email', $row->getSourceProperty('field_private_email'));
break;
}
// make sure that field_website url is absolute
$field_website = $row->getSourceProperty('field_user_website');
if(isset($field_website[0]['url'])){