popsu_migrate: D7NodeEvemenent ok
This commit is contained in:
@@ -40,87 +40,67 @@ process:
|
||||
migration: d7_node_programme
|
||||
source: nid
|
||||
no_stub: true
|
||||
|
||||
# field_theme:
|
||||
# plugin: migration_lookup
|
||||
# migration: d7_node_theme
|
||||
# source: field_theme
|
||||
# no_stub: true
|
||||
#
|
||||
# field_projet:
|
||||
# plugin: migration_lookup
|
||||
# migration: d7_node_projet
|
||||
# source: field_projet
|
||||
# no_stub: true
|
||||
#
|
||||
# field_poid: field_poids
|
||||
#
|
||||
# field_type_de_ressource:
|
||||
# plugin: migration_lookup
|
||||
# migration: d7_taxonomy_term_type_doc
|
||||
# source: field_popsu_doc_type
|
||||
# no_stub: true
|
||||
#
|
||||
# field_sous_titre:
|
||||
# plugin: sub_process
|
||||
# source: field_popsu_publication_soustitr
|
||||
# process:
|
||||
# value: value
|
||||
# # summary: summary
|
||||
# # format:
|
||||
# # plugin: default_value
|
||||
# # default_value: wysiwyg
|
||||
#
|
||||
# field_edition:
|
||||
# plugin: sub_process
|
||||
# source: field_popsu_doc_source
|
||||
# process:
|
||||
# value: value
|
||||
# summary: summary
|
||||
# format:
|
||||
# plugin: default_value
|
||||
# default_value: wysiwyg
|
||||
#
|
||||
# body:
|
||||
# plugin: sub_process
|
||||
# source: body
|
||||
# process:
|
||||
# value: value
|
||||
# summary: summary
|
||||
# format:
|
||||
# plugin: default_value
|
||||
# default_value: wysiwyg
|
||||
#
|
||||
#
|
||||
# field_image:
|
||||
# plugin: sub_process
|
||||
# source: field_popsu_publication_cover
|
||||
# process:
|
||||
# target_id:
|
||||
# plugin: migration_lookup
|
||||
# migration: d7_allpublicfiles
|
||||
# source: fid
|
||||
# no_stub: true
|
||||
# alt: alt
|
||||
# title: title
|
||||
#
|
||||
# field_fichier:
|
||||
# plugin: sub_process
|
||||
# source: field_popsu_doc_files
|
||||
# process:
|
||||
# target_id:
|
||||
# plugin: migration_lookup
|
||||
# migration: d7_allpublicfiles
|
||||
# source: fid
|
||||
# no_stub: true
|
||||
# display: display
|
||||
# description: description
|
||||
#
|
||||
# field_ressources_liees:
|
||||
# plugin: migration_lookup
|
||||
# migration: d7_node_ressource
|
||||
# source: field_projet
|
||||
# no_stub: true
|
||||
|
||||
field_theme:
|
||||
plugin: migration_lookup
|
||||
migration: d7_node_theme
|
||||
source: field_theme
|
||||
no_stub: true
|
||||
|
||||
field_projet:
|
||||
plugin: migration_lookup
|
||||
migration: d7_node_projet
|
||||
source: field_projet
|
||||
no_stub: true
|
||||
|
||||
field_sous_titre: field_popsu_colloque_subtitle
|
||||
|
||||
field_intro:
|
||||
plugin: sub_process
|
||||
source: field_popsu_colloque_subtitle2
|
||||
process:
|
||||
value: value
|
||||
summary: summary
|
||||
format:
|
||||
plugin: default_value
|
||||
default_value: wysiwyg
|
||||
|
||||
body:
|
||||
plugin: sub_process
|
||||
source: body
|
||||
process:
|
||||
value: value
|
||||
summary: summary
|
||||
format:
|
||||
plugin: default_value
|
||||
default_value: wysiwyg
|
||||
|
||||
# NO ITEM
|
||||
field_image:
|
||||
plugin: sub_process
|
||||
source: field_popsu_colloque_imageintro
|
||||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
migration: d7_allpublicfiles
|
||||
source: fid
|
||||
no_stub: true
|
||||
alt: alt
|
||||
title: title
|
||||
|
||||
# NO ITEM
|
||||
field_ressources_liees:
|
||||
plugin: migration_lookup
|
||||
migration: d7_node_ressource
|
||||
source: field_ressource
|
||||
no_stub: true
|
||||
|
||||
# NO ITEM
|
||||
field_evenements_liees:
|
||||
plugin: migration_lookup
|
||||
migration: d7_node_evenement
|
||||
source: field_evenement
|
||||
no_stub: true
|
||||
|
||||
field_memo: field_memo
|
||||
|
||||
|
@@ -91,7 +91,7 @@ class D7NodeEvenement extends FieldableEntity {
|
||||
'log',
|
||||
'timestamp',
|
||||
])
|
||||
->orderBy('type', 'ASC');
|
||||
->orderBy('type', 'DESC');
|
||||
|
||||
$query->addField('n', 'uid', 'node_uid');
|
||||
$query->addField('nr', 'uid', 'revision_uid');
|
||||
@@ -121,8 +121,8 @@ class D7NodeEvenement extends FieldableEntity {
|
||||
$field_values = $this->getFieldValues('node', $field_name, $nid, $vid, NULL);
|
||||
$row->setSourceProperty($field_name, $field_values);
|
||||
switch ($field_name) {
|
||||
case 'field_popsu_publication_body':
|
||||
case 'field_popsu_doc_body':
|
||||
case 'field_popsu_colloque_body':
|
||||
case 'body':
|
||||
$row->setSourceProperty("body", $field_values);
|
||||
break;
|
||||
}
|
||||
@@ -131,7 +131,12 @@ class D7NodeEvenement extends FieldableEntity {
|
||||
if ($type === "popsu_colloque") {
|
||||
// programme
|
||||
$field_programme = $row->getSourceProperty('field_popsu_colloque_popsu');
|
||||
|
||||
// projet
|
||||
// field_popsu_colloque_ville is not a projet but a ville
|
||||
if ($node = $row->getSourceProperty('field_popsu_colloque_ref')[0]) {
|
||||
$node['target_id'] = $node['nid'];
|
||||
$row->setSourceProperty('field_projet', $node);
|
||||
}
|
||||
} else { // evenement
|
||||
$field_popsu_doc_parent = $row->getSourceProperty('field_popsu_doc_parent');
|
||||
// get the node_type of doc_parent
|
||||
@@ -145,32 +150,41 @@ class D7NodeEvenement extends FieldableEntity {
|
||||
// }
|
||||
switch ($node['type']) {
|
||||
// programme
|
||||
case 'popsu_special': // NO ITEM
|
||||
case 'popsu_page': //NO ITEM
|
||||
Drush::output()->writeln(dump($node));
|
||||
// case 'popsu_special': // NO ITEM
|
||||
// case 'popsu_page': //NO ITEM
|
||||
// Drush::output()->writeln(dump($node));
|
||||
// break;
|
||||
// projet
|
||||
// case 'popsu_page_neutral': // no ref in migration
|
||||
// case 'popsu_projet_europe': // merged with popsu_ville_europe
|
||||
case 'popsu_ville_europe':
|
||||
case 'popsu_ville':
|
||||
case 'popsu_projet':
|
||||
// Drush::output()->writeln(dump($node));
|
||||
$node['target_id'] = $node['nid'];
|
||||
$row->setSourceProperty('field_projet', $node);
|
||||
break;
|
||||
// // projet
|
||||
// // case 'popsu_page_neutral': // no ref in migration
|
||||
// // case 'popsu_projet_europe': // merged with popsu_ville_europe
|
||||
// case 'popsu_ville_europe':
|
||||
// case 'popsu_ville':
|
||||
// case 'popsu_projet':
|
||||
// // Drush::output()->writeln(dump($node));
|
||||
// $node['target_id'] = $node['nid'];
|
||||
// $row->setSourceProperty('field_projet', $node);
|
||||
// break;
|
||||
// // Theme
|
||||
// case 'popsu_theme_europe':
|
||||
// case 'popsu_theme_trans':
|
||||
// case 'popsu_theme_local':
|
||||
// $node['target_id'] = $node['nid'];
|
||||
// $field_theme = $node;
|
||||
// break;
|
||||
// // publication
|
||||
// case 'popsu_publication':
|
||||
// $node['target_id'] = $node['nid'];
|
||||
// $row->setSourceProperty('field_ressources_liees', $node);
|
||||
// break;
|
||||
// Theme // NO ITEMS
|
||||
case 'popsu_theme_europe':
|
||||
case 'popsu_theme_trans':
|
||||
case 'popsu_theme_local':
|
||||
// $node['target_id'] = $node['nid'];
|
||||
Drush::output()->writeln(dump($node));
|
||||
$row->setSourceProperty('field_theme', $node);
|
||||
break;
|
||||
// publication // NO ITEM
|
||||
case 'popsu_publication':
|
||||
$node['target_id'] = $node['nid'];
|
||||
// Drush::output()->writeln(dump($node));
|
||||
$row->setSourceProperty('field_ressource', $node);
|
||||
break;
|
||||
// evenement // NO ITEM
|
||||
case 'popsu_colloque':
|
||||
$node['target_id'] = $node['nid'];
|
||||
Drush::output()->writeln(dump($node));
|
||||
$row->setSourceProperty('field_evenement', $node);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,10 +215,6 @@ class D7NodeEvenement extends FieldableEntity {
|
||||
$row->setSourceProperty('field_programme', array(array('nid'=>$prog[0]['nid'])));
|
||||
}
|
||||
|
||||
if (!empty($field_theme)) {
|
||||
// Drush::output()->writeln(dump($field_theme));
|
||||
$row->setSourceProperty('field_theme', $field_theme);
|
||||
}
|
||||
|
||||
// record migration errors in field_memo
|
||||
if(isset($memo)){
|
||||
|
Reference in New Issue
Block a user