migration materiau:thesaurus,tags,manufacturer,distributors,video; better admin node view

This commit is contained in:
Bachir Soussi Chiadmi 2018-12-12 12:46:53 +01:00
parent 8ac49ad737
commit be655ef81c
12 changed files with 505 additions and 27 deletions

View File

@ -46,12 +46,29 @@ process:
4: "workflow_imported"
5: "workflow_edited"
# field_thesaurus: field_onthologie
# field_tags: field_tags_libres
field_thesaurus:
plugin: migration_lookup
migration: d7_taxonomy_term_thesaurus
source: field_onthologie
field_tags:
plugin: migration_lookup
migration: d7_taxonomy_term_tags
source: field_tags_libres
field_manufacturer:
plugin: migration_lookup
migration: d7_taxonomy_term_company
source: field_company_fab
field_distributor:
plugin: migration_lookup
migration: d7_taxonomy_term_company
source: field_company_distrib
field_video:
plugin: iterator
source: field_video_filter
process:
value: url
# field_materiau_images: field_materiau_image
# field_video: field_video_filter
# field_manufacturer: field_company_fab
# field_distributor: field_company_distrib
# field_attachments: field_attachments
# field_linked_materials: field_materiau_ref
# field_linked_breves: field_breve_ref

View File

@ -109,8 +109,8 @@ class D7NodeMateriau extends FieldableEntity {
$nid = $row->getSourceProperty('nid');
$vid = $row->getSourceProperty('vid');
$type = $row->getSourceProperty('type');
drush_print('-- '.$language."\t".$nid);
$title = $row->getSourceProperty('title');
drush_print('-- '.$nid."\t".$title);
// If this entity was translated using Entity Translation, we need to get
// its source language to get the field values in the right language.
@ -119,8 +119,6 @@ class D7NodeMateriau extends FieldableEntity {
$entity_translatable = $this->isEntityTranslatable('node') && (int) $this->variableGet('language_content_type_' . $type, 0) === 4;
$language = $entity_translatable ? $this->getEntityTranslationSourceLanguage('node', $nid) : $row->getSourceProperty('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 and the field are
@ -128,6 +126,9 @@ class D7NodeMateriau extends FieldableEntity {
$field_language = $entity_translatable && $field['translatable'] ? $language : NULL;
$row->setSourceProperty($field_name, $this->getFieldValues('node', $field_name, $nid, $vid, $field_language));
}
if(!empty($row->getSourceProperty('field_video_filter'))){
print_r($row->getSourceProperty('field_video_filter'));
}
// Make sure we always have a translation set.
if ($row->getSourceProperty('tnid') == 0) {

View File

@ -1,9 +1,9 @@
uuid: f113a2b3-4712-484a-94d9-e755aa11b066
uuid: 6c5b9fb1-2e3f-4e9f-a9d1-c9205b8754cd
langcode: en
status: true
dependencies: { }
_core:
default_config_hash: yKRLVNGN4qBohpANHHYbIJR7GZba5K4Ojq0NJBWJkTM
default_config_hash: hvqfFuRl4fkwFbaDuwXun4zVkaLzZyTTCdcK-wx33ck
id: d7_node_materiau
class: null
field_plugin_method: null
@ -45,6 +45,27 @@ process:
3: workflow_visible
4: workflow_imported
5: workflow_edited
field_thesaurus:
plugin: migration_lookup
migration: d7_taxonomy_term_thesaurus
source: field_onthologie
field_tags:
plugin: migration_lookup
migration: d7_taxonomy_term_tags
source: field_tags_libres
field_manufacturer:
plugin: migration_lookup
migration: d7_taxonomy_term_company
source: field_company_fab
field_distributor:
plugin: migration_lookup
migration: d7_taxonomy_term_company
source: field_company_distrib
field_video:
plugin: iterator
source: field_video_filter
process:
value: url
destination:
plugin: 'entity:node'
migration_dependencies:

View File

@ -1,4 +1,4 @@
uuid: a69469c2-0d5a-432c-b906-223054de2196
uuid: 27e23cf6-2ea1-4076-9b8c-f497d8de08a1
langcode: en
status: true
dependencies: { }

View File

@ -1,4 +1,4 @@
uuid: 22243933-2e32-4739-8760-638eff3f9901
uuid: 14603995-5a4c-4b5c-b15c-23faabadc7aa
langcode: en
status: true
dependencies: { }

View File

@ -1,4 +1,4 @@
uuid: 86690803-46fe-456c-ad89-cf0cc53c0158
uuid: 6860a9c3-2980-4d62-9555-6f032bc32b70
langcode: en
status: true
dependencies: { }

View File

@ -1,4 +1,4 @@
uuid: 10660226-a750-44f8-8f51-faddf13e44b0
uuid: a70f11f2-29cb-454c-955a-5524fd9641fc
langcode: en
status: true
dependencies: { }

View File

@ -1,4 +1,4 @@
uuid: e3c72c0b-c97c-4f47-984a-a04ef7a51a9b
uuid: e0ba2b7b-ac37-46b1-b4a4-81e4d7b82dd4
langcode: en
status: true
dependencies: { }

View File

@ -1,4 +1,4 @@
uuid: 17e19467-985f-45e4-8e68-79a323cc8908
uuid: e7c566d9-2f1a-4a0b-83a4-94a94a3354d2
langcode: en
status: true
dependencies: { }

View File

@ -1,4 +1,4 @@
uuid: 2376dc54-4fa9-4570-9baf-a9d9b4446a74
uuid: 16893376-6f31-40ad-bac7-48119ad816ef
langcode: en
status: true
dependencies:

View File

@ -4,16 +4,16 @@ sql_signature: false
ui:
show:
additional_queries: false
advanced_column: false
master_display: false
advanced_column: true
master_display: true
performance_statistics: false
preview_information: true
sql_query:
enabled: false
where: above
display_embed: false
always_live_preview: true
exposed_filter_any_label: old_any
always_live_preview: false
exposed_filter_any_label: new_any
field_rewrite_elements:
div: DIV
span: SPAN

View File

@ -3,14 +3,21 @@ langcode: en
status: true
dependencies:
config:
- field.storage.node.field_distributor
- field.storage.node.field_manufacturer
- field.storage.node.field_memo
- field.storage.node.field_migration
- field.storage.node.field_tags
- field.storage.node.field_thesaurus
- field.storage.node.field_workflow
- taxonomy.vocabulary.company
module:
- better_exposed_filters
- content_lock
- content_translation
- node
- options
- taxonomy
- user
- views_bulk_operations
- workflow
@ -45,17 +52,83 @@ display:
query_comment: ''
query_tags: { }
exposed_form:
type: basic
type: bef
options:
submit_button: Apply
reset_button: false
reset_button: true
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
input_required: false
text_input_required: 'Select any filter and click on Apply to see results'
bef:
general:
allow_secondary: false
secondary_label: 'Advanced options'
autosubmit: false
autosubmit_exclude_textfield: false
autosubmit_hide: false
type:
bef_format: default
more_options:
bef_select_all_none: false
bef_collapsible: false
is_secondary: false
rewrite:
filter_rewrite_values: ''
langcode:
bef_format: default
more_options:
bef_select_all_none: false
bef_collapsible: false
is_secondary: false
rewrite:
filter_rewrite_values: ''
title:
bef_format: default
more_options:
is_secondary: false
placeholder_text: ''
field_manufacturer_target_id:
bef_format: default
more_options:
is_secondary: false
placeholder_text: ''
rewrite:
filter_rewrite_values: ''
field_distributor_target_id:
bef_format: default
more_options:
is_secondary: false
placeholder_text: ''
rewrite:
filter_rewrite_values: ''
field_memo_value:
bef_format: default
more_options:
is_secondary: false
placeholder_text: ''
field_migration_value:
bef_format: default
more_options:
bef_select_all_none: false
bef_collapsible: false
is_secondary: false
rewrite:
filter_rewrite_values: ''
field_workflow_value:
bef_format: default
more_options:
bef_select_all_none: false
bef_collapsible: false
is_secondary: false
rewrite:
filter_rewrite_values: ''
text_input_required_format: wysiwyg
pager:
type: mini
type: full
options:
items_per_page: 50
offset: 0
@ -64,6 +137,8 @@ display:
tags:
previous:
next:
first: '« First'
last: 'Last »'
expose:
items_per_page: false
items_per_page_label: 'Items per page'
@ -72,6 +147,7 @@ display:
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
quantity: 9
style:
type: table
options:
@ -511,6 +587,258 @@ display:
entity_type: node
entity_field: langcode
plugin_id: field
field_thesaurus:
id: field_thesaurus
table: node__field_thesaurus
field: field_thesaurus
relationship: none
group_type: group
admin_label: ''
label: Thesaurus
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: target_id
type: entity_reference_label
settings:
link: true
group_column: target_id
group_columns: { }
group_rows: true
delta_limit: 5
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: ol
separator: ', '
field_api_classes: false
plugin_id: field
field_tags:
id: field_tags
table: node__field_tags
field: field_tags
relationship: none
group_type: group
admin_label: ''
label: Tags
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: target_id
type: entity_reference_label
settings:
link: true
group_column: target_id
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
field_manufacturer:
id: field_manufacturer
table: node__field_manufacturer
field: field_manufacturer
relationship: none
group_type: group
admin_label: ''
label: Manufacturer
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: target_id
type: entity_reference_label
settings:
link: true
group_column: target_id
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
field_distributor:
id: field_distributor
table: node__field_distributor
field: field_distributor
relationship: none
group_type: group
admin_label: ''
label: Distributor
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: target_id
type: entity_reference_label
settings:
link: true
group_column: target_id
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
field_workflow:
id: field_workflow
table: node__field_workflow
@ -802,7 +1130,10 @@ display:
group_type: group
admin_label: ''
operator: in
value: { }
value:
en: en
fr: fr
und: und
group: 1
exposed: true
expose:
@ -813,7 +1144,7 @@ display:
operator: langcode_op
identifier: langcode
required: false
remember: true
remember: false
multiple: false
remember_roles:
authenticated: authenticated
@ -880,6 +1211,100 @@ display:
entity_type: node
entity_field: title
plugin_id: string
field_manufacturer_target_id:
id: field_manufacturer_target_id
table: node__field_manufacturer
field: field_manufacturer_target_id
relationship: none
group_type: group
admin_label: ''
operator: or
value: { }
group: 1
exposed: true
expose:
operator_id: field_manufacturer_target_id_op
label: Manufacturer
description: ''
use_operator: false
operator: field_manufacturer_target_id_op
identifier: field_manufacturer_target_id
required: false
remember: false
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: { }
reduce_duplicates: false
type: textfield
limit: true
vid: company
hierarchy: false
error_message: true
plugin_id: taxonomy_index_tid
field_distributor_target_id:
id: field_distributor_target_id
table: node__field_distributor
field: field_distributor_target_id
relationship: none
group_type: group
admin_label: ''
operator: or
value: { }
group: 1
exposed: true
expose:
operator_id: field_distributor_target_id_op
label: Distributor
description: ''
use_operator: false
operator: field_distributor_target_id_op
identifier: field_distributor_target_id
required: false
remember: false
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: { }
reduce_duplicates: false
type: textfield
limit: true
vid: company
hierarchy: false
error_message: true
plugin_id: taxonomy_index_tid
field_memo_value:
id: field_memo_value
table: node__field_memo
@ -1038,6 +1463,10 @@ display:
relationships: { }
arguments: { }
display_extenders: { }
filter_groups:
operator: AND
groups:
1: AND
cache_metadata:
max-age: 0
contexts:
@ -1045,11 +1474,16 @@ display:
- 'languages:language_interface'
- url
- url.query_args
- user
- 'user.node_grants:view'
- user.permissions
tags:
- 'config:field.storage.node.field_distributor'
- 'config:field.storage.node.field_manufacturer'
- 'config:field.storage.node.field_memo'
- 'config:field.storage.node.field_migration'
- 'config:field.storage.node.field_tags'
- 'config:field.storage.node.field_thesaurus'
- 'config:field.storage.node.field_workflow'
page_1:
display_plugin: page
@ -1066,9 +1500,14 @@ display:
- 'languages:language_interface'
- url
- url.query_args
- user
- 'user.node_grants:view'
- user.permissions
tags:
- 'config:field.storage.node.field_distributor'
- 'config:field.storage.node.field_manufacturer'
- 'config:field.storage.node.field_memo'
- 'config:field.storage.node.field_migration'
- 'config:field.storage.node.field_tags'
- 'config:field.storage.node.field_thesaurus'
- 'config:field.storage.node.field_workflow'