5 Commits 86792830fb ... 94ce3f7460

Author SHA1 Message Date
  Bachir Soussi Chiadmi 94ce3f7460 migration materiau & breve i18n ok 5 years ago
  Bachir Soussi Chiadmi 7b69f024c1 installed and activated webprofiler 5 years ago
  Bachir Soussi Chiadmi 0bf437f8d8 migration node materiau: field_location, field_samples 5 years ago
  Bachir Soussi Chiadmi 73f521ec9d materio_samples is working beta 5 years ago
  Bachir Soussi Chiadmi b8f572a83e migration node materiau: field_index, field_reference 5 years ago
37 changed files with 1263 additions and 185 deletions
  1. 1 0
      .gitignore
  2. 31 4
      composer.json
  3. 32 14
      composer.lock
  4. 8 0
      modules/custom/materio_id/materio_id.module
  5. 43 0
      modules/custom/materio_migrate/config/install/migrate_plus.migration.d7_node_breve_i18n.yml
  6. 17 9
      modules/custom/materio_migrate/config/install/migrate_plus.migration.d7_node_materiau.yml
  7. 44 0
      modules/custom/materio_migrate/config/install/migrate_plus.migration.d7_node_materiau_i18n.yml
  8. 128 0
      modules/custom/materio_migrate/src/Plugin/migrate/source/D7NodeBreveI18n.php
  9. 3 0
      modules/custom/materio_migrate/src/Plugin/migrate/source/D7NodeMateriau.php
  10. 128 0
      modules/custom/materio_migrate/src/Plugin/migrate/source/D7NodeMateriauI18n.php
  11. 7 0
      modules/custom/materio_samples/config/schema/materio_samples.schema.yml
  12. 11 0
      modules/custom/materio_samples/materio_samples.info.yml
  13. 57 0
      modules/custom/materio_samples/src/Plugin/Field/FieldFormatter/SamplesDefaultFormatter.php
  14. 125 0
      modules/custom/materio_samples/src/Plugin/Field/FieldType/SamplesItem.php
  15. 131 0
      modules/custom/materio_samples/src/Plugin/Field/FieldWidget/SamplesDefaultWidget.php
  16. 20 1
      sites/default/config/sync/core.entity_form_display.node.materiau.default.yml
  17. 18 0
      sites/default/config/sync/core.entity_view_display.node.materiau.default.yml
  18. 2 0
      sites/default/config/sync/core.extension.yml
  19. 1 1
      sites/default/config/sync/devel.settings.yml
  20. 19 0
      sites/default/config/sync/field.field.node.materiau.field_localisation_old.yml
  21. 22 0
      sites/default/config/sync/field.field.node.materiau.field_samples.yml
  22. 21 0
      sites/default/config/sync/field.storage.node.field_localisation_old.yml
  23. 19 0
      sites/default/config/sync/field.storage.node.field_samples.yml
  24. 1 1
      sites/default/config/sync/migrate_plus.migration.d7_allpublicfiles.yml
  25. 1 1
      sites/default/config/sync/migrate_plus.migration.d7_node_breve.yml
  26. 46 0
      sites/default/config/sync/migrate_plus.migration.d7_node_breve_i18n.yml
  27. 16 2
      sites/default/config/sync/migrate_plus.migration.d7_node_materiau.yml
  28. 47 0
      sites/default/config/sync/migrate_plus.migration.d7_node_materiau_i18n.yml
  29. 1 1
      sites/default/config/sync/migrate_plus.migration.d7_taxonomy_term_company.yml
  30. 1 1
      sites/default/config/sync/migrate_plus.migration.d7_taxonomy_term_showroom.yml
  31. 1 1
      sites/default/config/sync/migrate_plus.migration.d7_taxonomy_term_tags.yml
  32. 1 1
      sites/default/config/sync/migrate_plus.migration.d7_taxonomy_term_tags_i18n.yml
  33. 1 1
      sites/default/config/sync/migrate_plus.migration.d7_taxonomy_term_thesaurus.yml
  34. 1 1
      sites/default/config/sync/migrate_plus.migration.d7_taxonomy_term_thesaurus_i18n.yml
  35. 2 2
      sites/default/config/sync/migrate_plus.migration_group.d7_materio.yml
  36. 226 144
      sites/default/config/sync/views.view.admin_nodes.yml
  37. 30 0
      sites/default/config/sync/webprofiler.config.yml

+ 1 - 0
.gitignore

@@ -18,6 +18,7 @@ core
 /vendor/
 /modules/contrib/
 /themes/contrib/
+/libraries/
 
 # Ignore configuration files that may contain sensitive information.
 sites/*/settings*.php

+ 31 - 4
composer.json

@@ -4,10 +4,10 @@
     "type": "project",
     "license": "GPL-2.0-or-later",
     "require": {
-        "composer/installers": "^1.0.24",
+        "composer/installers": "^1.6",
         "wikimedia/composer-merge-plugin": "^1.4",
         "drupal/migrate_plus": "^4.0",
-        "drupal/migrate_tools": "^4.0",
+        "drupal/migrate_tools": "4.x-dev",
         "drupal/config_devel": "^1.2",
         "drupal/examples": "1.x-dev",
         "drupal/synonyms": "1.x-dev",
@@ -18,7 +18,9 @@
         "drupal/computed_field": "^2.0@alpha",
         "drupal/cshs": "1.x-dev",
         "drupal/views_ef_fieldset": "1.x-dev",
-        "drupal/pagerer": "^1.4"
+        "drupal/pagerer": "^1.4",
+        "d3/d3": "3.5.*",
+        "components/highlightjs": "9.7.*"
     },
     "replace": {
         "drupal/core": "^8.6"
@@ -53,7 +55,8 @@
             "themes/contrib/{$name}": ["type:drupal-theme"],
             "drush/contrib/{$name}": ["type:drupal-drush"],
             "modules/custom/{$name}": ["type:drupal-custom-module"],
-            "themes/custom/{$name}": ["type:drupal-custom-theme"]
+            "themes/custom/{$name}": ["type:drupal-custom-theme"],
+            "libraries/{$name}": ["type:drupal-library"]
         }
     },
     "autoload": {
@@ -75,6 +78,30 @@
         {
             "type": "composer",
             "url": "https://packages.drupal.org/8"
+        },
+        {
+            "type": "package",
+            "package": {
+                "name": "d3/d3",
+                "version": "v3.5.17",
+                "type": "drupal-library",
+                "dist": {
+                    "url": "https://github.com/d3/d3/archive/v3.5.17.zip",
+                    "type": "zip"
+                }
+            }
+        },
+        {
+            "type": "package",
+            "package": {
+                "name": "components/highlightjs",
+                "version": "9.7.0",
+                "type": "drupal-library",
+                "dist": {
+                    "url": "https://github.com/components/highlightjs/archive/9.7.0.zip",
+                    "type": "zip"
+                }
+            }
         }
     ]
 }

+ 32 - 14
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "1c2031518d90d8efedbecea6a76848c4",
+    "content-hash": "e5c93550d2c4086fc08a14ecabccb564",
     "packages": [
         {
             "name": "alchemy/zippy",
@@ -226,6 +226,17 @@
             ],
             "time": "2018-10-21T23:38:05+00:00"
         },
+        {
+            "name": "components/highlightjs",
+            "version": "9.7.0",
+            "dist": {
+                "type": "zip",
+                "url": "https://github.com/components/highlightjs/archive/9.7.0.zip",
+                "reference": null,
+                "shasum": null
+            },
+            "type": "drupal-library"
+        },
         {
             "name": "composer/installers",
             "version": "v1.6.0",
@@ -881,6 +892,17 @@
             "description": "Provides a way to patch Composer packages.",
             "time": "2018-05-11T18:00:16+00:00"
         },
+        {
+            "name": "d3/d3",
+            "version": "v3.5.17",
+            "dist": {
+                "type": "zip",
+                "url": "https://github.com/d3/d3/archive/v3.5.17.zip",
+                "reference": null,
+                "shasum": null
+            },
+            "type": "drupal-library"
+        },
         {
             "name": "dflydev/dot-access-configuration",
             "version": "v1.0.3",
@@ -5317,17 +5339,11 @@
         },
         {
             "name": "drupal/migrate_tools",
-            "version": "4.0.0",
+            "version": "dev-4.x",
             "source": {
                 "type": "git",
                 "url": "https://git.drupal.org/project/migrate_tools",
-                "reference": "8.x-4.0"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://ftp.drupal.org/files/projects/migrate_tools-8.x-4.0.zip",
-                "reference": "8.x-4.0",
-                "shasum": "016dfb010df76723c5a6a447921fdccd3c885237"
+                "reference": "9fc2977a80ad46dab0caa11682d269fe3bfe4985"
             },
             "require": {
                 "drupal/core": "^8.3",
@@ -5343,11 +5359,11 @@
                     "dev-4.x": "4.x-dev"
                 },
                 "drupal": {
-                    "version": "8.x-4.0",
-                    "datestamp": "1535380084",
+                    "version": "8.x-4.0+4-dev",
+                    "datestamp": "1540829581",
                     "security-coverage": {
-                        "status": "covered",
-                        "message": "Covered by Drupal's security advisory policy"
+                        "status": "not-covered",
+                        "message": "Dev releases are not covered by Drupal security advisories."
                     }
                 },
                 "drush": {
@@ -5380,7 +5396,8 @@
                 "source": "http://cgit.drupalcode.org/migrate_tools",
                 "issues": "http://drupal.org/project/migrate_tools",
                 "irc": "irc://irc.freenode.org/drupal-migrate"
-            }
+            },
+            "time": "2018-11-06T14:19:48+00:00"
         },
         {
             "name": "drupal/pagerer",
@@ -12377,6 +12394,7 @@
     "aliases": [],
     "minimum-stability": "dev",
     "stability-flags": {
+        "drupal/migrate_tools": 20,
         "drupal/examples": 20,
         "drupal/synonyms": 20,
         "drupal/telephone_formatter": 10,

+ 8 - 0
modules/custom/materio_id/materio_id.module

@@ -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
 

+ 43 - 0
modules/custom/materio_migrate/config/install/migrate_plus.migration.d7_node_breve_i18n.yml

@@ -0,0 +1,43 @@
+id: d7_node_breve_i18n
+label: Node Breve i18n
+migration_group: d7_materio
+audit: true
+migration_tags:
+  - Drupal 7
+  - Content
+  - Materio
+deriver: Drupal\node\Plugin\migrate\D7NodeDeriver
+
+source:
+  plugin: d7_node_breve_i18n
+  node_type: breve
+  translations: true
+
+destination:
+  plugin: entity:node
+  translations: true
+
+process:
+  nid:
+    plugin: migration_lookup
+    source: nid
+    migration: d7_node_breve
+    no_stub: true
+  type:
+    plugin: default_value
+    default_value: breve
+  langcode: language
+  content_translation_source: source
+  title: title
+  body:
+    plugin: iterator
+    source: body
+    process:
+      value: value
+      format:
+        plugin: default_value
+        default_value: wysiwyg
+
+migration_dependencies:
+  required:
+    - d7_node_breve

+ 17 - 9
modules/custom/materio_migrate/config/install/migrate_plus.migration.d7_node_materiau.yml

@@ -6,7 +6,7 @@ migration_tags:
   - Drupal 7
   - Content
   - Materio
-deriver: Drupal\taxonomy\Plugin\migrate\D7TaxonomyTermDeriver
+# deriver: Drupal\taxonomy\Plugin\migrate\D7TaxonomyTermDeriver
 
 source:
   plugin: d7_node_materiau
@@ -118,15 +118,23 @@ 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
-  # TODO: need to find an alternative or rebuild the custom module
-  # : field_location
+  field_localisation_old: field_localisation
+  # custom module rebuilded
+  field_samples:
+    plugin: iterator
+    source: field_location
+    process:
+      location: location
+      target_id:
+        plugin: migration_lookup
+        migration: d7_taxonomy_term_showroom
+        source: showroom_tid
+        no_stub: true
+
 
 migration_dependencies:
   required:

+ 44 - 0
modules/custom/materio_migrate/config/install/migrate_plus.migration.d7_node_materiau_i18n.yml

@@ -0,0 +1,44 @@
+id: d7_node_materiau_i18n
+label: Node Materiau i18n
+migration_group: d7_materio
+audit: true
+migration_tags:
+  - Drupal 7
+  - Content
+  - Materio
+deriver: Drupal\node\Plugin\migrate\D7NodeDeriver
+
+source:
+  plugin: d7_node_materiau_i18n
+  node_type: materiau
+  translations: true
+
+destination:
+  plugin: entity:node
+  translations: true
+
+process:
+  nid:
+    plugin: migration_lookup
+    source: nid
+    migration: d7_node_materiau
+    no_stub: true
+  type:
+    plugin: default_value
+    default_value: materiau
+  langcode: language
+  content_translation_source: source
+  title: title
+  field_short_description: field_nature_titre
+  body:
+    plugin: iterator
+    source: field_description
+    process:
+      value: value
+      format:
+        plugin: default_value
+        default_value: wysiwyg
+
+migration_dependencies:
+  required:
+    - d7_node_materiau

+ 128 - 0
modules/custom/materio_migrate/src/Plugin/migrate/source/D7NodeBreveI18n.php

@@ -0,0 +1,128 @@
+<?php
+
+namespace Drupal\materio_migrate\Plugin\migrate\source;
+
+use Drupal\migrate\Row;
+use Drupal\migrate_drupal\Plugin\migrate\source\d7\FieldableEntity;
+
+/**
+ * Provides Drupal 7 node entity translations source plugin.
+ *
+ * @MigrateSource(
+ *   id = "d7_node_breve_i18n",
+ *   source_module = "entity_translation"
+ * )
+ */
+class D7NodeBreveI18n extends FieldableEntity {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function query() {
+    $query = $this->select('entity_translation', 'et')
+      ->fields('et', [
+        'entity_id',
+        'revision_id',
+        'language',
+        'source',
+        'uid',
+        'status',
+        'created',
+        'changed',
+      ])
+      ->fields('n', [
+        'nid',
+        'title',
+        'type',
+        'promote',
+        'sticky',
+      ])
+      ->fields('nr', [
+        'log',
+        'timestamp',
+      ])
+      ->condition('et.entity_type', 'node')
+      ->condition('et.source', '', '<>');
+
+    $query->addField('nr', 'uid', 'revision_uid');
+
+    $query->innerJoin('node', 'n', 'n.nid = et.entity_id');
+    $query->innerJoin('node_revision', 'nr', 'nr.vid = et.revision_id');
+
+    if (isset($this->configuration['node_type'])) {
+      $query->condition('n.type', $this->configuration['node_type']);
+    }
+
+    return $query;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function prepareRow(Row $row) {
+    $nid = $row->getSourceProperty('entity_id');
+    $vid = $row->getSourceProperty('revision_id');
+    $type = $row->getSourceProperty('type');
+    $language = $row->getSourceProperty('language');
+    $title = $row->getSourceProperty('title');
+    // drush_print('-- '.$nid."\t".$title."\t".$language);
+
+    // Get Field API field values.
+    foreach ($this->getFields('node', $type) as $field_name => $field) {
+      // Ensure we're using the right language if the entity is translatable.
+      $field_language = $field['translatable'] ? $language : NULL;
+      $row->setSourceProperty($field_name, $this->getFieldValues('node', $field_name, $nid, $vid, $field_language));
+    }
+
+    // If the node title was replaced by a real field using the Drupal 7 Title
+    // module, use the field value instead of the node title.
+    if ($this->moduleExists('title')) {
+      $title_field = $row->getSourceProperty('title_field');
+      if (isset($title_field[0]['value'])) {
+        $row->setSourceProperty('title', $title_field[0]['value']);
+      }
+    }
+
+    return parent::prepareRow($row);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function fields() {
+    return [
+      'entity_id' => $this->t('Entity ID'),
+      'revision_id' => $this->t('Revision ID'),
+      'language' => $this->t('Node translation language'),
+      'source' => $this->t('Node translation source language'),
+      'uid' => $this->t('Node translation authored by (uid)'),
+      'status' => $this->t('Published'),
+      'created' => $this->t('Created timestamp'),
+      'changed' => $this->t('Modified timestamp'),
+      'title' => $this->t('Node title'),
+      'type' => $this->t('Node type'),
+      'promote' => $this->t('Promoted to front page'),
+      'sticky' => $this->t('Sticky at top of lists'),
+      'log' => $this->t('Revision log'),
+      'timestamp' => $this->t('The timestamp the latest revision of this node was created.'),
+      'revision_uid' => $this->t('Revision authored by (uid)'),
+    ];
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getIds() {
+    return [
+      'entity_id' => [
+        'type' => 'integer',
+        'alias' => 'et',
+      ],
+      'language' => [
+        'type' => 'string',
+        'alias' => 'et',
+      ],
+    ];
+  }
+
+}

+ 3 - 0
modules/custom/materio_migrate/src/Plugin/migrate/source/D7NodeMateriau.php

@@ -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) {

+ 128 - 0
modules/custom/materio_migrate/src/Plugin/migrate/source/D7NodeMateriauI18n.php

@@ -0,0 +1,128 @@
+<?php
+
+namespace Drupal\materio_migrate\Plugin\migrate\source;
+
+use Drupal\migrate\Row;
+use Drupal\migrate_drupal\Plugin\migrate\source\d7\FieldableEntity;
+
+/**
+ * Provides Drupal 7 node entity translations source plugin.
+ *
+ * @MigrateSource(
+ *   id = "d7_node_materiau_i18n",
+ *   source_module = "entity_translation"
+ * )
+ */
+class D7NodeMateriauI18n extends FieldableEntity {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function query() {
+    $query = $this->select('entity_translation', 'et')
+      ->fields('et', [
+        'entity_id',
+        'revision_id',
+        'language',
+        'source',
+        'uid',
+        'status',
+        'created',
+        'changed',
+      ])
+      ->fields('n', [
+        'nid',
+        'title',
+        'type',
+        'promote',
+        'sticky',
+      ])
+      ->fields('nr', [
+        'log',
+        'timestamp',
+      ])
+      ->condition('et.entity_type', 'node')
+      ->condition('et.source', '', '<>');
+
+    $query->addField('nr', 'uid', 'revision_uid');
+
+    $query->innerJoin('node', 'n', 'n.nid = et.entity_id');
+    $query->innerJoin('node_revision', 'nr', 'nr.vid = et.revision_id');
+
+    if (isset($this->configuration['node_type'])) {
+      $query->condition('n.type', $this->configuration['node_type']);
+    }
+
+    return $query;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function prepareRow(Row $row) {
+    $nid = $row->getSourceProperty('entity_id');
+    $vid = $row->getSourceProperty('revision_id');
+    $type = $row->getSourceProperty('type');
+    $language = $row->getSourceProperty('language');
+    $title = $row->getSourceProperty('title');
+    // drush_print('-- '.$nid."\t".$title."\t".$language);
+
+    // Get Field API field values.
+    foreach ($this->getFields('node', $type) as $field_name => $field) {
+      // Ensure we're using the right language if the entity is translatable.
+      $field_language = $field['translatable'] ? $language : NULL;
+      $row->setSourceProperty($field_name, $this->getFieldValues('node', $field_name, $nid, $vid, $field_language));
+    }
+
+    // If the node title was replaced by a real field using the Drupal 7 Title
+    // module, use the field value instead of the node title.
+    if ($this->moduleExists('title')) {
+      $title_field = $row->getSourceProperty('title_field');
+      if (isset($title_field[0]['value'])) {
+        $row->setSourceProperty('title', $title_field[0]['value']);
+      }
+    }
+
+    return parent::prepareRow($row);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function fields() {
+    return [
+      'entity_id' => $this->t('Entity ID'),
+      'revision_id' => $this->t('Revision ID'),
+      'language' => $this->t('Node translation language'),
+      'source' => $this->t('Node translation source language'),
+      'uid' => $this->t('Node translation authored by (uid)'),
+      'status' => $this->t('Published'),
+      'created' => $this->t('Created timestamp'),
+      'changed' => $this->t('Modified timestamp'),
+      'title' => $this->t('Node title'),
+      'type' => $this->t('Node type'),
+      'promote' => $this->t('Promoted to front page'),
+      'sticky' => $this->t('Sticky at top of lists'),
+      'log' => $this->t('Revision log'),
+      'timestamp' => $this->t('The timestamp the latest revision of this node was created.'),
+      'revision_uid' => $this->t('Revision authored by (uid)'),
+    ];
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getIds() {
+    return [
+      'entity_id' => [
+        'type' => 'integer',
+        'alias' => 'et',
+      ],
+      'language' => [
+        'type' => 'string',
+        'alias' => 'et',
+      ],
+    ];
+  }
+
+}

+ 7 - 0
modules/custom/materio_samples/config/schema/materio_samples.schema.yml

@@ -0,0 +1,7 @@
+field.field_settings.materio_samples_field:
+  type: mapping
+  label: 'Samples settings'
+  mapping:
+    vid:
+      type: string
+      label: 'Vocabulary'

+ 11 - 0
modules/custom/materio_samples/materio_samples.info.yml

@@ -0,0 +1,11 @@
+name: Materio Samples
+type: module
+description: "Provide a sample field, each showroom (taxonomy term) can fill it's own sample reference, and only it's own"
+core: 8.x
+package: Materio
+dependencies:
+  - taxonomy
+  - user
+
+# config_devel:
+#  install:

+ 57 - 0
modules/custom/materio_samples/src/Plugin/Field/FieldFormatter/SamplesDefaultFormatter.php

@@ -0,0 +1,57 @@
+<?php
+
+namespace Drupal\materio_samples\Plugin\Field\FieldFormatter;
+
+use Drupal\Core\Field\FormatterBase;
+use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\taxonomy\Entity\Term;
+
+/**
+ * Plugin implementation of the 'materio_samples_default_formatter' formatter.
+ *
+ * @FieldFormatter(
+ *   id = "materio_samples_default_formatter",
+ *   module = "materio_samples",
+ *   label = @Translation("Simple list key paired formatter"),
+ *   field_types = {
+ *     "materio_samples_field"
+ *   }
+ * )
+ */
+class SamplesDefaultFormatter extends FormatterBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function viewElements(FieldItemListInterface $items, $langcode) {
+    $language = \Drupal::languageManager()->getCurrentLanguage()->getId();
+
+    $elements = [];
+    foreach ($items as $delta => $item) {
+      // return nothing if target_id is null
+      if(!$item->target_id) return;
+
+      $term = Term::load($item->target_id);
+
+      // translate the term
+      $term = \Drupal::service('entity.repository')->getTranslationFromContext($term, $language);
+
+      $elements[$delta] = [
+        // We create a render array to produce the desired markup,
+        // "<p style="color: #hexcolor">The color code ... #hexcolor</p>".
+        // See theme_html_tag().
+        '#type' => 'html_tag',
+        '#tag' => 'span',
+        '#value' => $this->t('@target : @location', [
+            '@target' => $term->getName(),
+            '@location' => $item->location
+          ]
+        ),
+      ];
+    }
+
+
+    return $elements;
+  }
+
+}

+ 125 - 0
modules/custom/materio_samples/src/Plugin/Field/FieldType/SamplesItem.php

@@ -0,0 +1,125 @@
+<?php
+
+namespace Drupal\materio_samples\Plugin\Field\FieldType;
+
+use Drupal\Core\Field\FieldItemBase;
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\TypedData\DataDefinition;
+use Drupal\Core\TypedData\DataReferenceTargetDefinition;
+use Drupal\Core\StringTranslation\TranslatableMarkup;
+
+/**
+ * Plugin implementation of the 'field_example_rgb' field type.
+ *
+ * @FieldType(
+ *   id = "materio_samples_field",
+ *   label = @Translation("Samples"),
+ *   module = "materio_samples",
+ *   category = "Materio",
+ *   description = @Translation("Provide a sample field, each showroom (taxonomy term) can fill it's own sample reference, and only it's own."),
+ *   default_widget = "materio_samples_default_widget",
+ *   default_formatter = "materio_samples_default_formatter"
+ * )
+ */
+class SamplesItem extends FieldItemBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function schema(FieldStorageDefinitionInterface $field_definition) {
+    return [
+      'columns' => [
+        'location' => [
+          'description' => "The actual location reference in the showroom.",
+          'type' => 'text',
+          'size' => 'tiny',
+          // 'not null' => FALSE,
+        ],
+        'target_id' => [
+          'description' => 'the id of the target taxonomy term.',
+          'type' => 'int',
+          'unsigned' => TRUE
+        ]
+      ],
+      'indexes' => [
+        'target_id' => ['target_id'],
+      ],
+    ];
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function isEmpty() {
+    $value = $this->get('location')->getValue();
+    return $value === NULL || $value === '';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
+    $properties['location'] = DataDefinition::create('string')
+      ->setLabel(t('Reference'));
+
+    $properties['target_id'] = DataReferenceTargetDefinition::create('integer')
+        // ->setLabel(new TranslatableMarkup('@label ID', ['@label' => $target_type_info->getLabel()]))
+        ->setLabel(new TranslatableMarkup('@label ID', ['@label' => 'Showroom'])) // get voc name from settings
+        ->setSetting('unsigned', TRUE)
+        ->setRequired(TRUE);
+
+    return $properties;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function defaultFieldSettings() {
+    return [
+      // Declare a single setting, 'size', with a default
+      // value of 'large'
+      'vid' => null,
+    ] + parent::defaultFieldSettings();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
+    // dsm($form);
+
+    // get vocabularies
+    $vocabularies = \Drupal\taxonomy\Entity\Vocabulary::loadMultiple();
+    // dsm($vocabularies);
+    $options = [null => "choose"];
+    foreach ($vocabularies as $vid => $voc) {
+      $options[$voc->id()] = $voc->label();
+    }
+    // dsm($options);
+
+    $element = [];
+    // The key of the element should be the setting name
+    $element['vid'] = [
+      '#title' => $this->t('Vocabulary'),
+      '#type' => 'select',
+      '#options' => $options,
+      '#default_value' => $this->getSetting('vid'),
+    ];
+
+    return $element;
+  }
+
+  /**
+   * Form element validation handler; Invokes selection plugin's validation.
+   *
+   * @param array $form
+   *   The form where the settings form is being included in.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The form state of the (entire) configuration form.
+   */
+  public static function fieldSettingsFormValidate(array $form, FormStateInterface $form_state) {
+    $field = $form_state->getFormObject()->getEntity();
+    dsm($field);
+  }
+}

+ 131 - 0
modules/custom/materio_samples/src/Plugin/Field/FieldWidget/SamplesDefaultWidget.php

@@ -0,0 +1,131 @@
+<?php
+
+namespace Drupal\materio_samples\Plugin\Field\FieldWidget;
+
+use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\taxonomy\Entity\Term;
+use Drupal\workflow\Entity\WorkflowManager;
+
+/**
+ * Plugin implementation of the 'materio_samples_default_widget' widget.
+ *
+ * @FieldWidget(
+ *   id = "materio_samples_default_widget",
+ *   module = "materio_samples",
+ *   label = @Translation("Samples"),
+ *   field_types = {
+ *     "materio_samples_field"
+ *   }
+ * )
+ */
+class SamplesDefaultWidget extends WidgetBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function form(FieldItemListInterface $items, array &$form, FormStateInterface $form_state, $get_delta = NULL) {
+    // construct "manually" the list of items
+    $vid = $this->fieldDefinition->getSetting('vid');
+    $query = \Drupal::entityQuery('taxonomy_term')
+        ->sort('weight', 'DESC')
+        // ->sort('tid', 'DESC')
+        ->condition('vid', $vid);
+    $tids = $query->execute();
+    $terms = Term::loadMultiple($tids);
+
+    // define the cardinality, this will remove the add_more btn
+    $this->fieldDefinition->getFieldStorageDefinition()->setCardinality(count($terms));
+
+    $locations = [];
+    foreach ($items as $delta => $item) {
+      $locations[$item->target_id] = $item->location;
+    }
+
+    $delta = 0;
+    foreach ($terms as $term) {
+      // remove masqué
+      $sid = WorkflowManager::getCurrentStateId($term, 'field_workflow');
+      if($sid == 'workflow_hidden') continue;
+      $location = isset($locations[$term->id()]) ? $locations[$term->id()] : '';
+      $value = array(
+        'location' => $location,
+        'target_id'=> $term->id()
+      );
+      $items->set($delta, $value);
+      $delta ++;
+    }
+
+    // then call the normal form
+    $elements = parent::form($items, $form, $form_state, $get_delta);
+    // dsm($elements);
+
+    // Arrange the form object to remove draggable table stuff
+    $elements['widget']['#cardinality_multiple'] = FALSE;
+    for ($i=0; $i <= $delta ; $i++) {
+      if(isset($elements['widget'][$i]['_weight'])){
+        $elements['widget'][$i]['_weight']['#type'] = 'hidden';
+      }
+    }
+
+    return $elements;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
+    $language = \Drupal::languageManager()->getCurrentLanguage()->getId();
+
+    // get default values
+    $target_id = isset($items[$delta]->target_id) ? $items[$delta]->target_id : 0;
+    $location = isset($items[$delta]->location) ? $items[$delta]->location : '';
+    // dsm($target_id);
+
+    // return nothing if target_id is null
+    if(!$target_id) return;
+
+    $term = Term::load($target_id);
+
+    // translate the term
+    $term = \Drupal::service('entity.repository')->getTranslationFromContext($term, $language);
+
+    // dsm($element);
+    // $element['#attributes'] = array('class' => array('container-inline'));
+    // $element['container'] = [
+    //   '#type' => 'container',
+    //   '#field_prefix' => '<div class="container-inline">',
+    //   '#field_suffix' => '</div>',
+    // ];
+    $element['target_id'] = [
+      '#type' => 'hidden',
+      '#default_value' => $target_id,
+    ];
+    $element['location'] = [
+      '#title' => $term->getName(),
+      '#type' => 'textfield',
+      '#default_value' => $location,
+      '#size' => 10,
+      '#maxlength' => 15,
+      '#attributes' => ['class' => ['container-inline']],
+    ];
+    // return ['value' => $element];
+    return $element;
+  }
+
+  public function validate($element, FormStateInterface $form_state) {
+    // dsm($element);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function massageFormValues(array $values, array $form, FormStateInterface $form_state) {
+    // foreach ($values as $key => $value) {
+    //   $values[$key]['value']['target_id'] = (int)$values[$key]['value']['target_id'];
+    // }
+    dsm($values);
+    return $values;
+  }
+}

+ 20 - 1
sites/default/config/sync/core.entity_form_display.node.materiau.default.yml

@@ -10,11 +10,13 @@ dependencies:
     - field.field.node.materiau.field_index
     - field.field.node.materiau.field_linked_breves
     - field.field.node.materiau.field_linked_materials
+    - field.field.node.materiau.field_localisation_old
     - field.field.node.materiau.field_manufacturer
     - field.field.node.materiau.field_materiau_images
     - field.field.node.materiau.field_memo
     - field.field.node.materiau.field_migration
     - field.field.node.materiau.field_reference
+    - field.field.node.materiau.field_samples
     - field.field.node.materiau.field_short_description
     - field.field.node.materiau.field_tags
     - field.field.node.materiau.field_thesaurus
@@ -27,6 +29,7 @@ dependencies:
     - field_group
     - file
     - image
+    - materio_samples
     - text
     - video_embed_field
     - workflow
@@ -42,6 +45,7 @@ third_party_settings:
         - group_links
         - group_samples_showroom
         - group_internal
+        - group_samples
       parent_name: ''
       weight: 0
       format_type: tabs
@@ -135,7 +139,8 @@ third_party_settings:
         required_fields: true
       label: Links
     group_samples_showroom:
-      children: {  }
+      children:
+        - field_samples
       parent_name: group_htabs
       weight: 14
       format_type: tab
@@ -218,6 +223,14 @@ content:
     third_party_settings: {  }
     type: entity_reference_autocomplete
     region: content
+  field_localisation_old:
+    weight: 35
+    settings:
+      size: 60
+      placeholder: ''
+    third_party_settings: {  }
+    type: string_textfield
+    region: content
   field_manufacturer:
     weight: 15
     settings:
@@ -249,6 +262,12 @@ content:
     third_party_settings: {  }
     type: workflow_default
     region: content
+  field_samples:
+    weight: 34
+    settings: {  }
+    third_party_settings: {  }
+    type: materio_samples_default_widget
+    region: content
   field_short_description:
     weight: 2
     settings:

+ 18 - 0
sites/default/config/sync/core.entity_view_display.node.materiau.default.yml

@@ -10,11 +10,13 @@ dependencies:
     - field.field.node.materiau.field_index
     - field.field.node.materiau.field_linked_breves
     - field.field.node.materiau.field_linked_materials
+    - field.field.node.materiau.field_localisation_old
     - field.field.node.materiau.field_manufacturer
     - field.field.node.materiau.field_materiau_images
     - field.field.node.materiau.field_memo
     - field.field.node.materiau.field_migration
     - field.field.node.materiau.field_reference
+    - field.field.node.materiau.field_samples
     - field.field.node.materiau.field_short_description
     - field.field.node.materiau.field_tags
     - field.field.node.materiau.field_thesaurus
@@ -25,6 +27,7 @@ dependencies:
     - computed_field
     - file
     - image
+    - materio_samples
     - options
     - text
     - user
@@ -91,6 +94,14 @@ content:
     third_party_settings: {  }
     type: entity_reference_label
     region: content
+  field_localisation_old:
+    weight: 119
+    label: above
+    settings:
+      link_to_entity: false
+    third_party_settings: {  }
+    type: string
+    region: content
   field_manufacturer:
     weight: 107
     label: above
@@ -132,6 +143,13 @@ content:
     third_party_settings: {  }
     type: computed_string
     region: content
+  field_samples:
+    weight: 118
+    label: above
+    settings: {  }
+    third_party_settings: {  }
+    type: materio_samples_default_formatter
+    region: content
   field_short_description:
     weight: 102
     label: above

+ 2 - 0
sites/default/config/sync/core.extension.yml

@@ -66,6 +66,7 @@ module:
   mailsystem: 0
   materio_id: 0
   materio_migrate: 0
+  materio_samples: 0
   matomo: 0
   maxlength: 0
   menu_block: 0
@@ -111,6 +112,7 @@ module:
   views_bulk_operations: 0
   views_ef_fieldset: 0
   views_ui: 0
+  webprofiler: 0
   workflow: 0
   workflow_access: 0
   workflow_operations: 0

+ 1 - 1
sites/default/config/sync/devel.settings.yml

@@ -5,6 +5,6 @@ error_handlers:
 rebuild_theme: false
 debug_mail_file_format: '%to-%subject-%datetime.mail.txt'
 debug_mail_directory: 'temporary://devel-mails'
-devel_dumper: default
+devel_dumper: kint
 _core:
   default_config_hash: 8SYa5OOpQGdg4wnttb0LFNuG6GmivsS2qNv9sTH9gDI

+ 19 - 0
sites/default/config/sync/field.field.node.materiau.field_localisation_old.yml

@@ -0,0 +1,19 @@
+uuid: 6ad29f3c-c0c7-4c7d-beae-56cc71d7f0b9
+langcode: en
+status: true
+dependencies:
+  config:
+    - field.storage.node.field_localisation_old
+    - node.type.materiau
+id: node.materiau.field_localisation_old
+field_name: field_localisation_old
+entity_type: node
+bundle: materiau
+label: 'Localisation OLD'
+description: ''
+required: false
+translatable: false
+default_value: {  }
+default_value_callback: ''
+settings: {  }
+field_type: string

+ 22 - 0
sites/default/config/sync/field.field.node.materiau.field_samples.yml

@@ -0,0 +1,22 @@
+uuid: e1a0b688-5eeb-41c5-8b01-2bfd840d63fa
+langcode: en
+status: true
+dependencies:
+  config:
+    - field.storage.node.field_samples
+    - node.type.materiau
+  module:
+    - materio_samples
+id: node.materiau.field_samples
+field_name: field_samples
+entity_type: node
+bundle: materiau
+label: Samples
+description: ''
+required: false
+translatable: false
+default_value: {  }
+default_value_callback: ''
+settings:
+  vid: showroom
+field_type: materio_samples_field

+ 21 - 0
sites/default/config/sync/field.storage.node.field_localisation_old.yml

@@ -0,0 +1,21 @@
+uuid: 85069b08-23d9-4b14-b977-fd3eb9d4424c
+langcode: en
+status: true
+dependencies:
+  module:
+    - node
+id: node.field_localisation_old
+field_name: field_localisation_old
+entity_type: node
+type: string
+settings:
+  max_length: 255
+  is_ascii: false
+  case_sensitive: false
+module: core
+locked: false
+cardinality: 1
+translatable: true
+indexes: {  }
+persist_with_no_fields: false
+custom_storage: false

+ 19 - 0
sites/default/config/sync/field.storage.node.field_samples.yml

@@ -0,0 +1,19 @@
+uuid: be56dc4b-a9d2-4f35-b7da-236d73b827a8
+langcode: en
+status: true
+dependencies:
+  module:
+    - materio_samples
+    - node
+id: node.field_samples
+field_name: field_samples
+entity_type: node
+type: materio_samples_field
+settings: {  }
+module: materio_samples
+locked: false
+cardinality: -1
+translatable: true
+indexes: {  }
+persist_with_no_fields: false
+custom_storage: false

+ 1 - 1
sites/default/config/sync/migrate_plus.migration.d7_allpublicfiles.yml

@@ -1,4 +1,4 @@
-uuid: a7bc7a67-a8ab-4d55-9a8f-f2e21e4e7145
+uuid: c1e53484-bbe6-4b84-9502-43c121efcce3
 langcode: en
 status: true
 dependencies: {  }

+ 1 - 1
sites/default/config/sync/migrate_plus.migration.d7_node_breve.yml

@@ -1,4 +1,4 @@
-uuid: 0a46ed54-515f-40a0-8147-ac71d58c3f6c
+uuid: f0af3419-fade-4039-8d72-49c127b78ee5
 langcode: en
 status: true
 dependencies: {  }

+ 46 - 0
sites/default/config/sync/migrate_plus.migration.d7_node_breve_i18n.yml

@@ -0,0 +1,46 @@
+uuid: 8495df6b-dce0-4a7d-8a3e-a9462fe4c1a8
+langcode: en
+status: true
+dependencies: {  }
+_core:
+  default_config_hash: 24TmjnmLfhF_b5Amw02m1ndMgS_in_S13nmHQtnvdsU
+id: d7_node_breve_i18n
+class: null
+field_plugin_method: null
+cck_plugin_method: null
+migration_tags:
+  - 'Drupal 7'
+  - Content
+  - Materio
+migration_group: d7_materio
+label: 'Node Breve i18n'
+source:
+  plugin: d7_node_breve_i18n
+  node_type: breve
+  translations: true
+process:
+  nid:
+    plugin: migration_lookup
+    source: nid
+    migration: d7_node_breve
+    no_stub: true
+  type:
+    plugin: default_value
+    default_value: breve
+  langcode: language
+  content_translation_source: source
+  title: title
+  body:
+    plugin: iterator
+    source: body
+    process:
+      value: value
+      format:
+        plugin: default_value
+        default_value: wysiwyg
+destination:
+  plugin: 'entity:node'
+  translations: true
+migration_dependencies:
+  required:
+    - d7_node_breve

+ 16 - 2
sites/default/config/sync/migrate_plus.migration.d7_node_materiau.yml

@@ -1,9 +1,9 @@
-uuid: 9ff8173a-d98d-44f3-ad8b-aa7fc344ffca
+uuid: 36299c73-3088-4a62-b4b1-be7182e881aa
 langcode: en
 status: true
 dependencies: {  }
 _core:
-  default_config_hash: DnMjLkb9wXzqI2NMRiu9dKN5NujCtPmjLtvff6sz1Rk
+  default_config_hash: rh5NZM-nq2T5x5XOjpaNaHZZFAjkf4nwNthnAEJXN-8
 id: d7_node_materiau
 class: null
 field_plugin_method: null
@@ -116,6 +116,20 @@ process:
         source: fid
         no_stub: true
       description: description
+  field_famille: field_famille
+  field_index: field_identifiant
+  field_reference: field_reference_materio
+  field_localisation_old: field_localisation
+  field_samples:
+    plugin: iterator
+    source: field_location
+    process:
+      location: location
+      target_id:
+        plugin: migration_lookup
+        migration: d7_taxonomy_term_showroom
+        source: showroom_tid
+        no_stub: true
 destination:
   plugin: 'entity:node'
 migration_dependencies:

+ 47 - 0
sites/default/config/sync/migrate_plus.migration.d7_node_materiau_i18n.yml

@@ -0,0 +1,47 @@
+uuid: 6a648094-f449-4559-86ec-1433a672d9d5
+langcode: en
+status: true
+dependencies: {  }
+_core:
+  default_config_hash: ezODGhaONTf5KLDIrvVbJJqNKtq0nmV1mbuxKLP7Jzg
+id: d7_node_materiau_i18n
+class: null
+field_plugin_method: null
+cck_plugin_method: null
+migration_tags:
+  - 'Drupal 7'
+  - Content
+  - Materio
+migration_group: d7_materio
+label: 'Node Materiau i18n'
+source:
+  plugin: d7_node_materiau_i18n
+  node_type: materiau
+  translations: true
+process:
+  nid:
+    plugin: migration_lookup
+    source: nid
+    migration: d7_node_materiau
+    no_stub: true
+  type:
+    plugin: default_value
+    default_value: materiau
+  langcode: language
+  content_translation_source: source
+  title: title
+  field_short_description: field_nature_titre
+  body:
+    plugin: iterator
+    source: field_description
+    process:
+      value: value
+      format:
+        plugin: default_value
+        default_value: wysiwyg
+destination:
+  plugin: 'entity:node'
+  translations: true
+migration_dependencies:
+  required:
+    - d7_node_materiau

+ 1 - 1
sites/default/config/sync/migrate_plus.migration.d7_taxonomy_term_company.yml

@@ -1,4 +1,4 @@
-uuid: 97152dee-a197-455a-942b-35585342b022
+uuid: 68f144c3-730e-484d-a6fa-914823bb6457
 langcode: en
 status: true
 dependencies: {  }

+ 1 - 1
sites/default/config/sync/migrate_plus.migration.d7_taxonomy_term_showroom.yml

@@ -1,4 +1,4 @@
-uuid: ce9f81b5-4979-4f90-856a-a501f8e32d5e
+uuid: 9cd74ea1-4c1d-40fa-8cfb-086a6e215672
 langcode: en
 status: true
 dependencies: {  }

+ 1 - 1
sites/default/config/sync/migrate_plus.migration.d7_taxonomy_term_tags.yml

@@ -1,4 +1,4 @@
-uuid: ce7a00bb-f73b-468d-92ad-abde0e21f120
+uuid: 428aa5dc-ad7b-4e1f-97a4-bb98cc6b45f8
 langcode: en
 status: true
 dependencies: {  }

+ 1 - 1
sites/default/config/sync/migrate_plus.migration.d7_taxonomy_term_tags_i18n.yml

@@ -1,4 +1,4 @@
-uuid: 0eb8dd85-169f-4096-9aba-da1292c7a3dd
+uuid: fd4734b6-d910-4ddf-b28b-c57366e23201
 langcode: en
 status: true
 dependencies: {  }

+ 1 - 1
sites/default/config/sync/migrate_plus.migration.d7_taxonomy_term_thesaurus.yml

@@ -1,4 +1,4 @@
-uuid: fb77a05b-0bbc-4bba-aede-59b373ede799
+uuid: b624ff13-d668-41dc-87f5-8aed6df7c8b9
 langcode: en
 status: true
 dependencies: {  }

+ 1 - 1
sites/default/config/sync/migrate_plus.migration.d7_taxonomy_term_thesaurus_i18n.yml

@@ -1,4 +1,4 @@
-uuid: 1e6cd0f1-e949-4fac-b935-b26c09be445d
+uuid: c42fc9c9-3cf7-4b00-a35d-ed35225c75d1
 langcode: en
 status: true
 dependencies: {  }

+ 2 - 2
sites/default/config/sync/migrate_plus.migration_group.d7_materio.yml

@@ -1,5 +1,5 @@
-uuid: fb89ae32-f11e-4845-aaf4-476f3f295105
-langcode: en
+uuid: 9b0e7e6b-8866-44ea-95db-3ecb94a96d7e
+langcode: fr
 status: true
 dependencies:
   enforced:

+ 226 - 144
sites/default/config/sync/views.view.admin_nodes.yml

@@ -10,6 +10,8 @@ dependencies:
     - field.storage.node.field_materiau_images
     - field.storage.node.field_memo
     - field.storage.node.field_migration
+    - field.storage.node.field_reference
+    - field.storage.node.field_samples
     - field.storage.node.field_tags
     - field.storage.node.field_thesaurus
     - field.storage.node.field_visuel
@@ -19,9 +21,10 @@ dependencies:
     - user.role.admin
     - user.role.root
   module:
+    - computed_field
     - content_lock
-    - content_translation
     - image
+    - materio_samples
     - node
     - options
     - pagerer
@@ -102,17 +105,18 @@ display:
             views_bulk_operations_bulk_form: views_bulk_operations_bulk_form
             field_materiau_images: field_materiau_images
             field_visuel: field_materiau_images
+            field_reference: title
             nid: title
             title: title
-            edit_node: title
-            translation_link: title
-            langcode: langcode
+            operations: title
             field_thesaurus: field_thesaurus
             field_tags: field_tags
             field_manufacturer: field_manufacturer
             field_distributor: field_distributor
             field_linked_materials: field_linked_materials
             field_linked_breves: field_linked_breves
+            field_samples: field_samples
+            translation_count: translation_count
             field_workflow: field_workflow
             field_migration: field_migration
             is_locked: is_locked
@@ -133,37 +137,28 @@ display:
               separator: ''
               empty_column: false
               responsive: ''
-            nid:
+            field_reference:
               sortable: false
               default_sort_order: asc
               align: ''
               separator: ''
               empty_column: false
               responsive: ''
-            title:
-              sortable: false
-              default_sort_order: asc
-              align: ''
-              separator: '<br/>'
-              empty_column: false
-              responsive: ''
-            edit_node:
+            nid:
               sortable: false
               default_sort_order: asc
               align: ''
               separator: ''
               empty_column: false
               responsive: ''
-            translation_link:
+            title:
               sortable: false
               default_sort_order: asc
               align: ''
-              separator: ''
+              separator: '<br/>'
               empty_column: false
               responsive: ''
-            langcode:
-              sortable: false
-              default_sort_order: asc
+            operations:
               align: ''
               separator: ''
               empty_column: false
@@ -198,6 +193,18 @@ display:
               separator: ''
               empty_column: true
               responsive: ''
+            field_samples:
+              align: ''
+              separator: ''
+              empty_column: false
+              responsive: ''
+            translation_count:
+              sortable: false
+              default_sort_order: asc
+              align: ''
+              separator: ''
+              empty_column: false
+              responsive: ''
             field_workflow:
               sortable: false
               default_sort_order: asc
@@ -295,7 +302,7 @@ display:
             node_save_action: node_save_action
             node_make_sticky_action: 0
             views_bulk_edit: 0
-            views_bulk_operations_delete_entity: 0
+            views_bulk_operations_delete_entity: views_bulk_operations_delete_entity
             workflow_node_given_state_action: 0
             workflow_node_next_state_action: 0
             pathauto_update_alias: pathauto_update_alias
@@ -308,6 +315,8 @@ display:
               label_override: ''
             node_save_action:
               label_override: ''
+            views_bulk_operations_delete_entity:
+              label_override: ''
             pathauto_update_alias:
               label_override: ''
           plugin_id: views_bulk_operations_bulk_form
@@ -439,6 +448,71 @@ display:
           separator: ', '
           field_api_classes: false
           plugin_id: field
+        field_reference:
+          id: field_reference
+          table: node__field_reference
+          field: field_reference
+          relationship: none
+          group_type: group
+          admin_label: ''
+          label: Reference
+          exclude: false
+          alter:
+            alter_text: false
+            text: ''
+            make_link: false
+            path: ''
+            absolute: false
+            external: false
+            replace_spaces: false
+            path_case: none
+            trim_whitespace: false
+            alt: ''
+            rel: ''
+            link_class: ''
+            prefix: ''
+            suffix: ''
+            target: ''
+            nl2br: false
+            max_length: 0
+            word_boundary: true
+            ellipsis: true
+            more_link: false
+            more_link_text: ''
+            more_link_path: ''
+            strip_tags: false
+            trim: false
+            preserve_tags: ''
+            html: false
+          element_type: ''
+          element_class: ''
+          element_label_type: ''
+          element_label_class: ''
+          element_label_colon: true
+          element_wrapper_type: ''
+          element_wrapper_class: ''
+          element_default_classes: true
+          empty: ''
+          hide_empty: false
+          empty_zero: false
+          hide_alter_empty: true
+          click_sort_column: value
+          type: computed_string
+          settings:
+            sanitized: 1
+            cache_unit: '-1'
+            cache_duration: '1'
+          group_column: value
+          group_columns: {  }
+          group_rows: true
+          delta_limit: 0
+          delta_offset: 0
+          delta_reversed: false
+          delta_first_last: false
+          multi_type: separator
+          separator: ', '
+          field_api_classes: false
+          plugin_id: field
         nid:
           id: nid
           table: node_field_data
@@ -447,7 +521,7 @@ display:
           group_type: group
           admin_label: ''
           label: ID
-          exclude: false
+          exclude: true
           alter:
             alter_text: false
             text: ''
@@ -552,14 +626,14 @@ display:
           multi_type: separator
           separator: ', '
           field_api_classes: false
-        edit_node:
-          id: edit_node
+        operations:
+          id: operations
           table: node
-          field: edit_node
+          field: operations
           relationship: none
           group_type: group
           admin_label: ''
-          label: Edit
+          label: 'Operations links'
           exclude: false
           alter:
             alter_text: false
@@ -600,72 +674,17 @@ display:
           hide_empty: false
           empty_zero: false
           hide_alter_empty: true
-          text: edit
-          output_url_as_text: false
-          absolute: false
+          destination: true
           entity_type: node
-          plugin_id: entity_link_edit
-        translation_link:
-          id: translation_link
-          table: node
-          field: translation_link
-          relationship: none
-          group_type: group
-          admin_label: ''
-          label: Translate
-          exclude: false
-          alter:
-            alter_text: false
-            text: ''
-            make_link: false
-            path: ''
-            absolute: false
-            external: false
-            replace_spaces: false
-            path_case: none
-            trim_whitespace: false
-            alt: ''
-            rel: ''
-            link_class: ''
-            prefix: ''
-            suffix: ''
-            target: ''
-            nl2br: false
-            max_length: 0
-            word_boundary: true
-            ellipsis: true
-            more_link: false
-            more_link_text: ''
-            more_link_path: ''
-            strip_tags: false
-            trim: false
-            preserve_tags: ''
-            html: false
-          element_type: ''
-          element_class: ''
-          element_label_type: ''
-          element_label_class: ''
-          element_label_colon: true
-          element_wrapper_type: ''
-          element_wrapper_class: ''
-          element_default_classes: true
-          empty: ''
-          hide_empty: false
-          empty_zero: false
-          hide_alter_empty: true
-          text: Translate
-          output_url_as_text: 0
-          absolute: 0
-          entity_type: node
-          plugin_id: content_translation_link
-        langcode:
-          id: langcode
-          table: node
-          field: langcode
+          plugin_id: entity_operations
+        field_thesaurus:
+          id: field_thesaurus
+          table: node__field_thesaurus
+          field: field_thesaurus
           relationship: none
           group_type: group
           admin_label: ''
-          label: 'Original language'
+          label: Thesaurus
           exclude: false
           alter:
             alter_text: false
@@ -706,32 +725,29 @@ display:
           hide_empty: false
           empty_zero: false
           hide_alter_empty: true
-          click_sort_column: value
-          type: language
+          click_sort_column: target_id
+          type: entity_reference_label
           settings:
-            link_to_entity: false
-            native_language: false
-          group_column: value
+            link: true
+          group_column: target_id
           group_columns: {  }
           group_rows: true
-          delta_limit: 0
+          delta_limit: 5
           delta_offset: 0
           delta_reversed: false
           delta_first_last: false
           multi_type: separator
-          separator: ', '
+          separator: '<br/>'
           field_api_classes: false
-          entity_type: node
-          entity_field: langcode
           plugin_id: field
-        field_thesaurus:
-          id: field_thesaurus
-          table: node__field_thesaurus
-          field: field_thesaurus
+        field_tags:
+          id: field_tags
+          table: node__field_tags
+          field: field_tags
           relationship: none
           group_type: group
           admin_label: ''
-          label: Thesaurus
+          label: Tags
           exclude: false
           alter:
             alter_text: false
@@ -779,22 +795,22 @@ display:
           group_column: target_id
           group_columns: {  }
           group_rows: true
-          delta_limit: 5
+          delta_limit: 0
           delta_offset: 0
           delta_reversed: false
           delta_first_last: false
           multi_type: separator
-          separator: '<br/>'
+          separator: ', '
           field_api_classes: false
           plugin_id: field
-        field_tags:
-          id: field_tags
-          table: node__field_tags
-          field: field_tags
+        field_manufacturer:
+          id: field_manufacturer
+          table: node__field_manufacturer
+          field: field_manufacturer
           relationship: none
           group_type: group
           admin_label: ''
-          label: Tags
+          label: Manufacturer
           exclude: false
           alter:
             alter_text: false
@@ -850,14 +866,14 @@ display:
           separator: ', '
           field_api_classes: false
           plugin_id: field
-        field_manufacturer:
-          id: field_manufacturer
-          table: node__field_manufacturer
-          field: field_manufacturer
+        field_distributor:
+          id: field_distributor
+          table: node__field_distributor
+          field: field_distributor
           relationship: none
           group_type: group
           admin_label: ''
-          label: Manufacturer
+          label: Distributor
           exclude: false
           alter:
             alter_text: false
@@ -913,14 +929,14 @@ display:
           separator: ', '
           field_api_classes: false
           plugin_id: field
-        field_distributor:
-          id: field_distributor
-          table: node__field_distributor
-          field: field_distributor
+        field_linked_materials:
+          id: field_linked_materials
+          table: node__field_linked_materials
+          field: field_linked_materials
           relationship: none
           group_type: group
           admin_label: ''
-          label: Distributor
+          label: 'Linked Materials'
           exclude: false
           alter:
             alter_text: false
@@ -973,17 +989,17 @@ display:
           delta_reversed: false
           delta_first_last: false
           multi_type: separator
-          separator: ', '
+          separator: '<br/>'
           field_api_classes: false
           plugin_id: field
-        field_linked_materials:
-          id: field_linked_materials
-          table: node__field_linked_materials
-          field: field_linked_materials
+        field_linked_breves:
+          id: field_linked_breves
+          table: node__field_linked_breves
+          field: field_linked_breves
           relationship: none
           group_type: group
           admin_label: ''
-          label: 'Linked Materials'
+          label: 'Linked Brèves'
           exclude: false
           alter:
             alter_text: false
@@ -1039,14 +1055,14 @@ display:
           separator: '<br/>'
           field_api_classes: false
           plugin_id: field
-        field_linked_breves:
-          id: field_linked_breves
-          table: node__field_linked_breves
-          field: field_linked_breves
+        field_samples:
+          id: field_samples
+          table: node__field_samples
+          field: field_samples
           relationship: none
           group_type: group
           admin_label: ''
-          label: 'Linked Brèves'
+          label: Samples
           exclude: false
           alter:
             alter_text: false
@@ -1087,11 +1103,10 @@ display:
           hide_empty: false
           empty_zero: false
           hide_alter_empty: true
-          click_sort_column: target_id
-          type: entity_reference_label
-          settings:
-            link: true
-          group_column: target_id
+          click_sort_column: location
+          type: materio_samples_default_formatter
+          settings: {  }
+          group_column: ''
           group_columns: {  }
           group_rows: true
           delta_limit: 0
@@ -1385,6 +1400,53 @@ display:
           entity_type: node
           entity_field: type
           plugin_id: bundle
+        langcode_1:
+          id: langcode_1
+          table: node_field_data
+          field: langcode
+          relationship: none
+          group_type: group
+          admin_label: ''
+          operator: in
+          value:
+            en: en
+            fr: fr
+            und: und
+            zxx: zxx
+          group: 1
+          exposed: true
+          expose:
+            operator_id: langcode_1_op
+            label: 'Translation language'
+            description: ''
+            use_operator: false
+            operator: langcode_1_op
+            identifier: langcode_1
+            required: false
+            remember: true
+            multiple: false
+            remember_roles:
+              authenticated: authenticated
+              anonymous: '0'
+              admin: '0'
+              root: '0'
+              user: '0'
+            reduce: false
+          is_grouped: false
+          group_info:
+            label: ''
+            description: ''
+            identifier: ''
+            optional: true
+            widget: select
+            multiple: false
+            remember: false
+            default_group: All
+            default_group_multiple: {  }
+            group_items: {  }
+          entity_type: node
+          entity_field: langcode
+          plugin_id: language
         langcode:
           id: langcode
           table: node
@@ -1749,6 +1811,8 @@ display:
         - 'config:field.storage.node.field_materiau_images'
         - 'config:field.storage.node.field_memo'
         - 'config:field.storage.node.field_migration'
+        - 'config:field.storage.node.field_reference'
+        - 'config:field.storage.node.field_samples'
         - 'config:field.storage.node.field_tags'
         - 'config:field.storage.node.field_thesaurus'
         - 'config:field.storage.node.field_visuel'
@@ -1780,31 +1844,37 @@ display:
                   title: ''
                   description: ''
                   open: '1'
-                  weight: '-21'
+                  weight: '-23'
                   id: container-0
                   pid: root
                   depth: '1'
                   type: container
                 type:
-                  weight: '-21'
+                  weight: '-23'
                   id: type
                   pid: container-0
                   depth: '2'
                   type: filter
+                langcode_1:
+                  weight: '-22'
+                  id: langcode_1
+                  pid: container-0
+                  depth: '2'
+                  type: filter
                 langcode:
-                  weight: '-20'
+                  weight: '-21'
                   id: langcode
                   pid: container-0
                   depth: '2'
                   type: filter
                 title:
-                  weight: '-19'
+                  weight: '-20'
                   id: title
                   pid: container-0
                   depth: '2'
                   type: filter
                 field_memo_value:
-                  weight: '-18'
+                  weight: '-19'
                   id: field_memo_value
                   pid: container-0
                   depth: '2'
@@ -1879,7 +1949,7 @@ display:
                   container_type: details
                   title: 'Container 4'
                   description: ''
-                  weight: '-15'
+                  weight: '-17'
                   open: 0
                   id: container-4
                   pid: root
@@ -1889,7 +1959,7 @@ display:
                   container_type: details
                   title: 'Container 5'
                   description: ''
-                  weight: '-14'
+                  weight: '-16'
                   open: 0
                   id: container-5
                   pid: root
@@ -1899,7 +1969,7 @@ display:
                   container_type: details
                   title: 'Container 6'
                   description: ''
-                  weight: '-13'
+                  weight: '-15'
                   open: 0
                   id: container-6
                   pid: root
@@ -1909,7 +1979,7 @@ display:
                   container_type: details
                   title: 'Container 7'
                   description: ''
-                  weight: '-12'
+                  weight: '-14'
                   open: 0
                   id: container-7
                   pid: root
@@ -1919,7 +1989,7 @@ display:
                   container_type: details
                   title: 'Container 8'
                   description: ''
-                  weight: '-11'
+                  weight: '-13'
                   open: 0
                   id: container-8
                   pid: root
@@ -1929,12 +1999,22 @@ display:
                   container_type: details
                   title: 'Container 9'
                   description: ''
-                  weight: '-10'
+                  weight: '-12'
                   open: 0
                   id: container-9
                   pid: root
                   depth: '1'
                   type: container
+                container-10:
+                  container_type: details
+                  title: 'Container 10'
+                  description: ''
+                  weight: '-11'
+                  open: 0
+                  id: container-10
+                  pid: root
+                  depth: '1'
+                  type: container
       path: admin/content/nodes
     cache_metadata:
       max-age: 0
@@ -1954,6 +2034,8 @@ display:
         - 'config:field.storage.node.field_materiau_images'
         - 'config:field.storage.node.field_memo'
         - 'config:field.storage.node.field_migration'
+        - 'config:field.storage.node.field_reference'
+        - 'config:field.storage.node.field_samples'
         - 'config:field.storage.node.field_tags'
         - 'config:field.storage.node.field_thesaurus'
         - 'config:field.storage.node.field_visuel'

+ 30 - 0
sites/default/config/sync/webprofiler.config.yml

@@ -0,0 +1,30 @@
+purge_on_cache_clear: true
+storage: profiler.database_storage
+exclude: "/contextual/*\r\n/toolbar/*\r\n/edit/*\r\n*.js\r\n*.css"
+ide_link: 'txmt://open?url=file://@file&line=@line'
+ide_link_remote: ''
+ide_link_local: ''
+active_toolbar_items:
+  devel: devel
+  assets: assets
+  blocks: blocks
+  cache: cache
+  database: database
+  drupal_extension: drupal_extension
+  forms: forms
+  performance_timing: performance_timing
+  php_config: php_config
+  request: request
+  time: time
+  user: user
+  views: views
+  config: '0'
+  events: '0'
+  http: '0'
+  routing: '0'
+  services: '0'
+  state: '0'
+query_sort: source
+query_highlight: 5
+_core:
+  default_config_hash: w1Hg1sJmlqc38y_J-HQH8kLDLRH3wuEhx-Fkwz7m-SI