migration node materiau: field_index, field_reference

This commit is contained in:
2018-12-17 17:31:28 +01:00
parent 86792830fb
commit b8f572a83e
5 changed files with 25 additions and 19 deletions

View File

@@ -2,6 +2,11 @@
function computed_field_field_index_compute($entity_type_manager, $entity, $fields, $delta){
// drush_print($entity->field_index->value);
if (!empty($entity->field_index->value)) { // the node is not new
return $entity->field_index->value;
}
/* FROM D7
@@ -61,6 +66,9 @@ function computed_field_field_index_compute($entity_type_manager, $entity, $fiel
// }
function computed_field_field_reference_compute($entity_type_manager, $entity, $fields, $delta) {
if (!empty($entity->field_reference->value)) { // the node is not new
return $entity->field_reference->value;
}
/* FROM D7

View File

@@ -118,10 +118,9 @@ process:
no_stub: true
# there is no description field filled
description: description
# field_famille: field_famille
# field_index: field_identifiant
# field_reference: field_reference_materio
field_famille: field_famille
field_index: field_identifiant
field_reference: field_reference_materio
# just archives
# : field_localisation

View File

@@ -147,6 +147,9 @@ class D7NodeMateriau extends FieldableEntity {
}
$row->setSourceProperty('linked_breves', $linked_breves);
// print_r($row->getSourceProperty('field_identifiant'));
// print_r($row->getSourceProperty('field_reference_materio'));
// Make sure we always have a translation set.
if ($row->getSourceProperty('tnid') == 0) {