popsu_migrate: D7NodeRessource ok
This commit is contained in:
@@ -55,25 +55,72 @@ process:
|
||||
|
||||
field_poid: field_poids
|
||||
|
||||
# body: body
|
||||
field_type_de_ressource:
|
||||
plugin: migration_lookup
|
||||
migration: d7_taxonomy_term_type_doc
|
||||
source: field_popsu_doc_type
|
||||
no_stub: true
|
||||
|
||||
# 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_textes: field_textes
|
||||
#
|
||||
# field_equipes: field_equipes
|
||||
#
|
||||
# field_partenaires: field_partenaires
|
||||
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_memo: field_memo
|
||||
|
||||
@@ -81,4 +128,4 @@ migration_dependencies:
|
||||
required:
|
||||
- d7_allpublicfiles
|
||||
- d7_users
|
||||
- d7_taxonomy_term_type_theme
|
||||
- d7_taxonomy_term_type_doc
|
||||
|
@@ -91,7 +91,7 @@ class D7NodeRessource extends FieldableEntity {
|
||||
'log',
|
||||
'timestamp',
|
||||
])
|
||||
->orderBy('changed');
|
||||
->orderBy('type', 'DESC');
|
||||
|
||||
$query->addField('n', 'uid', 'node_uid');
|
||||
$query->addField('nr', 'uid', 'revision_uid');
|
||||
@@ -110,7 +110,7 @@ class D7NodeRessource extends FieldableEntity {
|
||||
$vid = $row->getSourceProperty('vid');
|
||||
$type = $row->getSourceProperty('type');
|
||||
$title = $row->getSourceProperty('title');
|
||||
Drush::output()->writeln('- - - - ' . $title . ' ('.$nid.')' . '- - - - ');
|
||||
Drush::output()->writeln('- - - - ' . $title . ' ('.$nid.')'. ' ['.$type.']' . '- - - - ');
|
||||
|
||||
$memo = '';
|
||||
$memo .= "#migration : old nid = ".$nid."\n";
|
||||
@@ -120,10 +120,12 @@ class D7NodeRessource extends FieldableEntity {
|
||||
foreach ($this->getFields('node', $type) as $field_name => $field) {
|
||||
$field_values = $this->getFieldValues('node', $field_name, $nid, $vid, NULL);
|
||||
$row->setSourceProperty($field_name, $field_values);
|
||||
// if ($field_name == 'field_poids') {
|
||||
// $field_values = $field_values[0];
|
||||
// Drush::output()->writeln(dump($field_values));
|
||||
// }
|
||||
switch ($field_name) {
|
||||
case 'field_popsu_publication_body':
|
||||
case 'field_popsu_doc_body':
|
||||
$row->setSourceProperty("body", $field_values);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($type === "popsu_publication") {
|
||||
@@ -158,7 +160,7 @@ class D7NodeRessource extends FieldableEntity {
|
||||
case 'popsu_projet':
|
||||
// Drush::output()->writeln(dump($node));
|
||||
$node['target_id'] = $node['nid'];
|
||||
$field_projet = $node;
|
||||
$row->setSourceProperty('field_projet', $node);
|
||||
break;
|
||||
// Theme
|
||||
case 'popsu_theme_europe':
|
||||
@@ -166,6 +168,12 @@ class D7NodeRessource extends FieldableEntity {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,11 +203,6 @@ class D7NodeRessource extends FieldableEntity {
|
||||
$row->setSourceProperty('field_programme', array(array('nid'=>$prog[0]['nid'])));
|
||||
}
|
||||
|
||||
if (!empty($field_projet)) {
|
||||
// Drush::output()->writeln(dump($field_projet));
|
||||
$row->setSourceProperty('field_projet', $field_projet);
|
||||
}
|
||||
|
||||
if (!empty($field_theme)) {
|
||||
// Drush::output()->writeln(dump($field_theme));
|
||||
$row->setSourceProperty('field_theme', $field_theme);
|
||||
|
Reference in New Issue
Block a user