migration node materiau: field_index, field_reference

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

View File

@ -7,7 +7,7 @@
"composer/installers": "^1.0.24", "composer/installers": "^1.0.24",
"wikimedia/composer-merge-plugin": "^1.4", "wikimedia/composer-merge-plugin": "^1.4",
"drupal/migrate_plus": "^4.0", "drupal/migrate_plus": "^4.0",
"drupal/migrate_tools": "^4.0", "drupal/migrate_tools": "4.x-dev",
"drupal/config_devel": "^1.2", "drupal/config_devel": "^1.2",
"drupal/examples": "1.x-dev", "drupal/examples": "1.x-dev",
"drupal/synonyms": "1.x-dev", "drupal/synonyms": "1.x-dev",

24
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "1c2031518d90d8efedbecea6a76848c4", "content-hash": "feb474307bb454795da76ad5e40b4825",
"packages": [ "packages": [
{ {
"name": "alchemy/zippy", "name": "alchemy/zippy",
@ -5317,17 +5317,11 @@
}, },
{ {
"name": "drupal/migrate_tools", "name": "drupal/migrate_tools",
"version": "4.0.0", "version": "dev-4.x",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.drupal.org/project/migrate_tools", "url": "https://git.drupal.org/project/migrate_tools",
"reference": "8.x-4.0" "reference": "9fc2977a80ad46dab0caa11682d269fe3bfe4985"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/migrate_tools-8.x-4.0.zip",
"reference": "8.x-4.0",
"shasum": "016dfb010df76723c5a6a447921fdccd3c885237"
}, },
"require": { "require": {
"drupal/core": "^8.3", "drupal/core": "^8.3",
@ -5343,11 +5337,11 @@
"dev-4.x": "4.x-dev" "dev-4.x": "4.x-dev"
}, },
"drupal": { "drupal": {
"version": "8.x-4.0", "version": "8.x-4.0+4-dev",
"datestamp": "1535380084", "datestamp": "1540829581",
"security-coverage": { "security-coverage": {
"status": "covered", "status": "not-covered",
"message": "Covered by Drupal's security advisory policy" "message": "Dev releases are not covered by Drupal security advisories."
} }
}, },
"drush": { "drush": {
@ -5380,7 +5374,8 @@
"source": "http://cgit.drupalcode.org/migrate_tools", "source": "http://cgit.drupalcode.org/migrate_tools",
"issues": "http://drupal.org/project/migrate_tools", "issues": "http://drupal.org/project/migrate_tools",
"irc": "irc://irc.freenode.org/drupal-migrate" "irc": "irc://irc.freenode.org/drupal-migrate"
} },
"time": "2018-11-06T14:19:48+00:00"
}, },
{ {
"name": "drupal/pagerer", "name": "drupal/pagerer",
@ -12377,6 +12372,7 @@
"aliases": [], "aliases": [],
"minimum-stability": "dev", "minimum-stability": "dev",
"stability-flags": { "stability-flags": {
"drupal/migrate_tools": 20,
"drupal/examples": 20, "drupal/examples": 20,
"drupal/synonyms": 20, "drupal/synonyms": 20,
"drupal/telephone_formatter": 10, "drupal/telephone_formatter": 10,

View File

@ -2,6 +2,11 @@
function computed_field_field_index_compute($entity_type_manager, $entity, $fields, $delta){ 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 /* 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) { 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 /* FROM D7

View File

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

View File

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