popsu_migrate: D7NodeProjet body, diaporama ok

This commit is contained in:
Bachir Soussi Chiadmi 2021-04-20 10:43:26 +02:00
parent 2d890bae99
commit 3db2e683b7
12 changed files with 83 additions and 21 deletions

View File

@ -27,12 +27,12 @@ third_party_settings:
field_group: field_group:
group_tabs: group_tabs:
children: children:
- group_prin
- group_textes - group_textes
- group_equipes - group_equipes
- group_partenaires - group_partenaires
- group_liens - group_liens
- group_media - group_media
- group_prin
parent_name: '' parent_name: ''
weight: 3 weight: 3
format_type: tabs format_type: tabs
@ -120,6 +120,7 @@ third_party_settings:
children: children:
- status - status
- promote - promote
- field_memo
parent_name: '' parent_name: ''
weight: 20 weight: 20
format_type: details_sidebar format_type: details_sidebar
@ -203,7 +204,7 @@ content:
type: entity_reference_autocomplete type: entity_reference_autocomplete
region: content region: content
field_memo: field_memo:
weight: 27 weight: 2
settings: settings:
rows: 5 rows: 5
placeholder: '' placeholder: ''
@ -288,7 +289,7 @@ content:
region: content region: content
promote: promote:
type: boolean_checkbox type: boolean_checkbox
weight: 0 weight: 1
region: content region: content
settings: settings:
display_label: true display_label: true

View File

@ -1,4 +1,4 @@
uuid: 68572ca4-7034-4619-93fb-7746d5444c87 uuid: 841402db-9c2a-490f-b9d8-b7635222ff7c
langcode: fr langcode: fr
status: true status: true
dependencies: { } dependencies: { }

View File

@ -1,4 +1,4 @@
uuid: 87cdeb88-a1c1-4b93-a825-af4ac6e1a64c uuid: 70ec992f-6317-4548-a0d5-7312d708049a
langcode: fr langcode: fr
status: true status: true
dependencies: { } dependencies: { }

View File

@ -1,9 +1,9 @@
uuid: 7bc4232f-4cf7-47b8-a18f-55cb75054a79 uuid: 9c90276c-fc70-4c57-b6c6-c6e019f399ea
langcode: fr langcode: fr
status: true status: true
dependencies: { } dependencies: { }
_core: _core:
default_config_hash: 2YwRSmCFiJrKbOiF_Y33rBPNxqM9llOfJdc67FOg-lU default_config_hash: Ao7_pCurVcLD722BrzKUfG6-hi5wqeGa55gblh-ILZE
id: d7_node_projet id: d7_node_projet
class: null class: null
field_plugin_method: null field_plugin_method: null
@ -65,6 +65,18 @@ process:
plugin: migration_lookup plugin: migration_lookup
migration: d7_node_projet migration: d7_node_projet
source: nid source: nid
body: body
field_diaporama:
plugin: sub_process
source: diaporama
process:
target_id:
plugin: migration_lookup
migration: d7_allpublicfiles
source: fid
no_stub: true
alt: alt
title: title
field_memo: field_memo field_memo: field_memo
destination: destination:
plugin: 'entity:node' plugin: 'entity:node'

View File

@ -1,4 +1,4 @@
uuid: 76257738-6915-4128-95f7-933ff4889c8d uuid: be024a37-e0f3-4133-874c-0618ef044101
langcode: fr langcode: fr
status: true status: true
dependencies: { } dependencies: { }

View File

@ -1,4 +1,4 @@
uuid: 7ab17bc8-b6e0-4687-932b-1648ef18b94d uuid: 65728399-9895-4b60-ae00-a41ba9a9c7ae
langcode: fr langcode: fr
status: true status: true
dependencies: { } dependencies: { }

View File

@ -1,4 +1,4 @@
uuid: 2e8300b7-a2a1-44da-81f7-935c84c24a13 uuid: 232f115d-07fa-4758-9984-0afd44bd7b05
langcode: fr langcode: fr
status: true status: true
dependencies: { } dependencies: { }

View File

@ -1,4 +1,4 @@
uuid: b4840ade-bdc4-49ac-a1ac-8b34e1c72222 uuid: b4ee97e9-2597-465f-8342-f1722ba9fcfc
langcode: fr langcode: fr
status: true status: true
dependencies: { } dependencies: { }

View File

@ -1,4 +1,4 @@
uuid: 6b775d9f-8a38-42ac-9fa0-1502ebc69527 uuid: 3a602f8f-c61e-4156-a96e-5ae0630490d6
langcode: fr langcode: fr
status: true status: true
dependencies: dependencies:

View File

@ -4,6 +4,7 @@ status: true
dependencies: dependencies:
config: config:
- field.storage.node.field_comparatifs_associes - field.storage.node.field_comparatifs_associes
- field.storage.node.field_diaporama
- field.storage.node.field_image - field.storage.node.field_image
- field.storage.node.field_memo - field.storage.node.field_memo
- field.storage.node.field_programme - field.storage.node.field_programme
@ -1748,14 +1749,14 @@ display:
hide_alter_empty: true hide_alter_empty: true
plugin_id: node_bulk_form plugin_id: node_bulk_form
entity_type: node entity_type: node
field_image: field_diaporama:
id: field_image id: field_diaporama
table: node__field_image table: node__field_diaporama
field: field_image field: field_diaporama
relationship: none relationship: none
group_type: group group_type: group
admin_label: '' admin_label: ''
label: Image label: Diaporama
exclude: false exclude: false
alter: alter:
alter_text: false alter_text: false
@ -1788,7 +1789,7 @@ display:
element_class: '' element_class: ''
element_label_type: '' element_label_type: ''
element_label_class: '' element_label_class: ''
element_label_colon: false element_label_colon: true
element_wrapper_type: '' element_wrapper_type: ''
element_wrapper_class: '' element_wrapper_class: ''
element_default_classes: true element_default_classes: true
@ -1804,7 +1805,7 @@ display:
group_column: '' group_column: ''
group_columns: { } group_columns: { }
group_rows: true group_rows: true
delta_limit: 0 delta_limit: 1
delta_offset: 0 delta_offset: 0
delta_reversed: false delta_reversed: false
delta_first_last: false delta_first_last: false
@ -2320,7 +2321,7 @@ display:
max-age: 0 max-age: 0
tags: tags:
- 'config:field.storage.node.field_comparatifs_associes' - 'config:field.storage.node.field_comparatifs_associes'
- 'config:field.storage.node.field_image' - 'config:field.storage.node.field_diaporama'
- 'config:field.storage.node.field_memo' - 'config:field.storage.node.field_memo'
- 'config:field.storage.node.field_programme' - 'config:field.storage.node.field_programme'
- 'config:field.storage.node.field_projets_lies' - 'config:field.storage.node.field_projets_lies'

View File

@ -75,8 +75,21 @@ process:
migration: d7_node_projet migration: d7_node_projet
source: nid source: nid
field_memo: field_memo body: body
field_diaporama:
plugin: sub_process
source: diaporama
process:
target_id:
plugin: migration_lookup
migration: d7_allpublicfiles
source: fid
no_stub: true
alt: alt
title: title
field_memo: field_memo
migration_dependencies: migration_dependencies:
required: required:

View File

@ -139,6 +139,15 @@ class D7NodeProjet extends FieldableEntity {
case 'field_popsu_projet_popsu': case 'field_popsu_projet_popsu':
$field_programme = $field_values; $field_programme = $field_values;
break; break;
case 'field_popsu_ville_body':
$field_body = $field_values;
break;
case 'field_popsu_villeur_body':
$field_body = $field_values;
break;
case 'field_popsu_projet_presentation':
$field_body = $field_values;
break;
} }
} }
if ($field_programme) { if ($field_programme) {
@ -241,6 +250,32 @@ class D7NodeProjet extends FieldableEntity {
$row->setSourceProperty('field_themes_lies', $field_themes_lies); $row->setSourceProperty('field_themes_lies', $field_themes_lies);
} }
// Body
if ($field_body) {
$field_body[0]['format'] = 'wysiwyg';
$row->setSourceProperty('body', $field_body);
}
// Diaporama
$field_diaporama = array();
$img_src_fields = array(
'field_popsu_ville_images_illustr',
'field_popsu_projeteur_thumb',
'field_popsu_projeteur_diapo',
'field_popsu_projet_imageintro',
'field_popsu_projet_imagelocalise',
);
foreach ($img_src_fields as $field_name) {
if ($imgs = $row->getSourceProperty($field_name)) {
foreach ($imgs as $img) {
$field_diaporama[] = $img;
}
}
}
if (!empty($field_diaporama)) {
$row->setSourceProperty('diaporama', $field_diaporama);
}
// record migration errors in field_memo // record migration errors in field_memo
if(isset($memo)){ if(isset($memo)){
$field_memo = array( $field_memo = array(