popsu_migrate: D7NodeActu ok
This commit is contained in:
parent
3ad0c731f9
commit
c1b92143ef
@ -8,6 +8,7 @@ dependencies:
|
||||
- field.field.node.actualite.field_evenements_lies
|
||||
- field.field.node.actualite.field_fichier
|
||||
- field.field.node.actualite.field_image
|
||||
- field.field.node.actualite.field_memo
|
||||
- field.field.node.actualite.field_programme
|
||||
- field.field.node.actualite.field_projet
|
||||
- field.field.node.actualite.field_ressources_liees
|
||||
@ -16,10 +17,10 @@ dependencies:
|
||||
- image.style.thumbnail
|
||||
- node.type.actualite
|
||||
module:
|
||||
- datetime_range
|
||||
- field_group
|
||||
- file
|
||||
- image
|
||||
- smart_date
|
||||
- text
|
||||
third_party_settings:
|
||||
field_group:
|
||||
@ -27,6 +28,7 @@ third_party_settings:
|
||||
children:
|
||||
- promote
|
||||
- status
|
||||
- field_memo
|
||||
parent_name: ''
|
||||
weight: 200
|
||||
format_type: details_sidebar
|
||||
@ -56,10 +58,10 @@ third_party_settings:
|
||||
group_pri:
|
||||
children:
|
||||
- field_sous_titre
|
||||
- field_dates_actu
|
||||
- field_programme
|
||||
- field_projet
|
||||
- field_theme
|
||||
- field_dates_actu
|
||||
- body
|
||||
parent_name: group_tabs
|
||||
weight: 20
|
||||
@ -118,14 +120,10 @@ content:
|
||||
third_party_settings: { }
|
||||
region: content
|
||||
field_dates_actu:
|
||||
weight: 4
|
||||
settings:
|
||||
modal: false
|
||||
default_duration: 60
|
||||
default_duration_increments: "30\n60|1 hour\n90\n120|2 hours\ncustom"
|
||||
show_extra: true
|
||||
weight: 1
|
||||
settings: { }
|
||||
third_party_settings: { }
|
||||
type: smartdate_default
|
||||
type: daterange_default
|
||||
region: content
|
||||
field_evenements_lies:
|
||||
weight: 129
|
||||
@ -152,8 +150,16 @@ content:
|
||||
third_party_settings: { }
|
||||
type: image_image
|
||||
region: content
|
||||
field_memo:
|
||||
weight: 17
|
||||
settings:
|
||||
rows: 5
|
||||
placeholder: ''
|
||||
third_party_settings: { }
|
||||
type: string_textarea
|
||||
region: content
|
||||
field_programme:
|
||||
weight: 1
|
||||
weight: 2
|
||||
settings:
|
||||
match_operator: CONTAINS
|
||||
match_limit: 10
|
||||
@ -163,7 +169,7 @@ content:
|
||||
type: entity_reference_autocomplete
|
||||
region: content
|
||||
field_projet:
|
||||
weight: 2
|
||||
weight: 3
|
||||
settings:
|
||||
match_operator: CONTAINS
|
||||
match_limit: 10
|
||||
@ -191,7 +197,7 @@ content:
|
||||
type: string_textfield
|
||||
region: content
|
||||
field_theme:
|
||||
weight: 3
|
||||
weight: 4
|
||||
settings:
|
||||
match_operator: CONTAINS
|
||||
match_limit: 10
|
||||
@ -211,7 +217,7 @@ content:
|
||||
type: boolean_checkbox
|
||||
settings:
|
||||
display_label: true
|
||||
weight: 120
|
||||
weight: 16
|
||||
region: content
|
||||
third_party_settings: { }
|
||||
title:
|
||||
|
@ -8,6 +8,7 @@ dependencies:
|
||||
- field.field.node.actualite.field_evenements_lies
|
||||
- field.field.node.actualite.field_fichier
|
||||
- field.field.node.actualite.field_image
|
||||
- field.field.node.actualite.field_memo
|
||||
- field.field.node.actualite.field_programme
|
||||
- field.field.node.actualite.field_projet
|
||||
- field.field.node.actualite.field_ressources_liees
|
||||
@ -15,9 +16,9 @@ dependencies:
|
||||
- field.field.node.actualite.field_theme
|
||||
- node.type.actualite
|
||||
module:
|
||||
- datetime_range
|
||||
- file
|
||||
- image
|
||||
- smart_date
|
||||
- text
|
||||
- user
|
||||
id: node.actualite.default
|
||||
@ -33,16 +34,14 @@ content:
|
||||
third_party_settings: { }
|
||||
region: content
|
||||
field_dates_actu:
|
||||
weight: 106
|
||||
weight: 114
|
||||
label: above
|
||||
settings:
|
||||
format: default
|
||||
force_chronological: false
|
||||
add_classes: 0
|
||||
separator: '-'
|
||||
format_type: medium
|
||||
timezone_override: ''
|
||||
third_party_settings: { }
|
||||
type: smartdate_default
|
||||
type: daterange_default
|
||||
region: content
|
||||
field_evenements_lies:
|
||||
weight: 109
|
||||
@ -69,6 +68,13 @@ content:
|
||||
third_party_settings: { }
|
||||
type: image
|
||||
region: content
|
||||
field_memo:
|
||||
weight: 113
|
||||
label: above
|
||||
settings: { }
|
||||
third_party_settings: { }
|
||||
type: basic_string
|
||||
region: content
|
||||
field_programme:
|
||||
weight: 102
|
||||
label: above
|
||||
|
@ -9,6 +9,7 @@ dependencies:
|
||||
- field.field.node.actualite.field_evenements_lies
|
||||
- field.field.node.actualite.field_fichier
|
||||
- field.field.node.actualite.field_image
|
||||
- field.field.node.actualite.field_memo
|
||||
- field.field.node.actualite.field_programme
|
||||
- field.field.node.actualite.field_projet
|
||||
- field.field.node.actualite.field_ressources_liees
|
||||
@ -41,6 +42,7 @@ hidden:
|
||||
field_evenements_lies: true
|
||||
field_fichier: true
|
||||
field_image: true
|
||||
field_memo: true
|
||||
field_programme: true
|
||||
field_projet: true
|
||||
field_ressources_liees: true
|
||||
|
@ -1,4 +1,4 @@
|
||||
uuid: b1acba14-ed54-4ff4-9a1e-69fb298c2e2f
|
||||
uuid: cd269d00-7119-46ae-bfc2-25ad94067e76
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
@ -6,21 +6,16 @@ dependencies:
|
||||
- field.storage.node.field_dates_actu
|
||||
- node.type.actualite
|
||||
module:
|
||||
- smart_date
|
||||
- datetime_range
|
||||
id: node.actualite.field_dates_actu
|
||||
field_name: field_dates_actu
|
||||
entity_type: node
|
||||
bundle: actualite
|
||||
label: Dates
|
||||
label: 'Dates actu'
|
||||
description: ''
|
||||
required: false
|
||||
translatable: false
|
||||
default_value:
|
||||
-
|
||||
default_date_type: ''
|
||||
default_date: ''
|
||||
default_duration_increments: "30\r\n60|1 hour\r\n90\r\n120|2 hours\r\ncustom"
|
||||
default_duration: 60
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings: { }
|
||||
field_type: smartdate
|
||||
field_type: daterange
|
||||
|
19
config/sync/field.field.node.actualite.field_memo.yml
Normal file
19
config/sync/field.field.node.actualite.field_memo.yml
Normal file
@ -0,0 +1,19 @@
|
||||
uuid: ec9af1cd-b8ad-4d60-969b-68a66d70815f
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.field_memo
|
||||
- node.type.actualite
|
||||
id: node.actualite.field_memo
|
||||
field_name: field_memo
|
||||
entity_type: node
|
||||
bundle: actualite
|
||||
label: memo
|
||||
description: ''
|
||||
required: false
|
||||
translatable: true
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings: { }
|
||||
field_type: string_long
|
@ -1,18 +1,19 @@
|
||||
uuid: f7e47b8a-6b86-4b1f-b91a-c577975f71d5
|
||||
uuid: a7efce6a-3f5b-41f5-a317-fdd388563b5d
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- datetime_range
|
||||
- node
|
||||
- smart_date
|
||||
id: node.field_dates_actu
|
||||
field_name: field_dates_actu
|
||||
entity_type: node
|
||||
type: smartdate
|
||||
settings: { }
|
||||
module: smart_date
|
||||
type: daterange
|
||||
settings:
|
||||
datetime_type: allday
|
||||
module: datetime_range
|
||||
locked: false
|
||||
cardinality: -1
|
||||
cardinality: 1
|
||||
translatable: true
|
||||
indexes: { }
|
||||
persist_with_no_fields: false
|
||||
|
@ -1,4 +1,4 @@
|
||||
uuid: cf4124c8-cc6b-450b-9ede-328076235970
|
||||
uuid: 6f7aa7cb-e247-4ad6-a69b-ae9d566168c7
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
|
92
config/sync/migrate_plus.migration.d7_node_actu.yml
Normal file
92
config/sync/migrate_plus.migration.d7_node_actu.yml
Normal file
@ -0,0 +1,92 @@
|
||||
uuid: 567d6005-ed2f-4492-8b9e-1e9257be0fe0
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
_core:
|
||||
default_config_hash: I6GROOhFniRjxHdI9dtO9yVSViggMTS5H7jUOHZEMIU
|
||||
id: d7_node_actu
|
||||
class: null
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- Content
|
||||
- Popsu
|
||||
migration_group: popsu
|
||||
label: 'Node actu'
|
||||
source:
|
||||
plugin: d7_node_actu
|
||||
batch_size: 500
|
||||
process:
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: actualite
|
||||
created: created
|
||||
changed: changed
|
||||
uid:
|
||||
plugin: default_value
|
||||
default_value: 34
|
||||
title: title
|
||||
field_sous_titre: field_popsu_actu_soustitre
|
||||
promote:
|
||||
plugin: default_value
|
||||
default_value: 0
|
||||
source: field_popsu_actu_enhome
|
||||
field_dates_actu:
|
||||
-
|
||||
plugin: skip_on_empty
|
||||
method: process
|
||||
source: field_date
|
||||
-
|
||||
plugin: sub_process
|
||||
process:
|
||||
value:
|
||||
plugin: format_date
|
||||
from_format: 'Y-m-d H:i:s'
|
||||
to_format: 'Y-m-d\TH:i:s'
|
||||
source: value
|
||||
end_value:
|
||||
plugin: format_date
|
||||
from_format: 'Y-m-d H:i:s'
|
||||
to_format: 'Y-m-d\TH:i:s'
|
||||
source: end
|
||||
timezone:
|
||||
plugin: default_value
|
||||
default_value: ''
|
||||
body:
|
||||
plugin: sub_process
|
||||
source: field_popsu_actu_body
|
||||
process:
|
||||
value: value
|
||||
summary: summary
|
||||
format:
|
||||
plugin: default_value
|
||||
default_value: wysiwyg
|
||||
field_fichier:
|
||||
plugin: sub_process
|
||||
source: field_popsu_actu_attachment
|
||||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
migration: d7_allpublicfiles
|
||||
source: fid
|
||||
no_stub: true
|
||||
display: display
|
||||
description: description
|
||||
field_image:
|
||||
plugin: sub_process
|
||||
source: field_popsu_actu_image
|
||||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
migration: d7_allpublicfiles
|
||||
source: fid
|
||||
no_stub: true
|
||||
alt: alt
|
||||
title: title
|
||||
field_memo: field_memo
|
||||
destination:
|
||||
plugin: 'entity:node'
|
||||
migration_dependencies:
|
||||
required:
|
||||
- d7_allpublicfiles
|
@ -1,9 +1,9 @@
|
||||
uuid: be789f3f-d3d7-48c3-8a70-b93119076a41
|
||||
uuid: b03ae923-6ae9-4c80-ad37-e708198fa881
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
_core:
|
||||
default_config_hash: xRLAUHUEsPu8KEzDWCJXTmDeJV_GjCcaFRfmeFVyngI
|
||||
default_config_hash: MS8tsr-1_51NXldBPGyjMyJ0FirHg8jPH3btyD9bWbM
|
||||
id: d7_node_evenement
|
||||
class: null
|
||||
field_plugin_method: null
|
||||
@ -92,5 +92,3 @@ destination:
|
||||
migration_dependencies:
|
||||
required:
|
||||
- d7_allpublicfiles
|
||||
- d7_users
|
||||
- d7_taxonomy_term_type_theme
|
||||
|
@ -1,4 +1,4 @@
|
||||
uuid: 59b95e8c-21fb-434f-b6a6-cc668e524c32
|
||||
uuid: 353b0f84-fc09-4f03-93f4-4db572c7599c
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
|
@ -1,4 +1,4 @@
|
||||
uuid: cb12b218-4bf0-436d-9153-5031392c95de
|
||||
uuid: e0e8b952-474b-4991-87b9-3dccf0c79810
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
|
@ -1,4 +1,4 @@
|
||||
uuid: b153072c-b974-482e-9b41-64e4b696ee60
|
||||
uuid: ed533655-6d55-4cd6-9890-39feb2361701
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
|
@ -1,4 +1,4 @@
|
||||
uuid: 652e81fb-fd06-4257-90c1-8b34ff9f015b
|
||||
uuid: 280c74af-f8a1-4ef4-9cd6-682742f37b55
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
|
@ -1,4 +1,4 @@
|
||||
uuid: e68b1dc2-d70d-4a89-a6c0-10507b257f83
|
||||
uuid: 0d6ed43f-4c5f-4002-b34e-2adb84dc5208
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
|
@ -1,4 +1,4 @@
|
||||
uuid: df19211c-2485-44f6-bb2e-a92a6d5371d2
|
||||
uuid: d802decf-b5d4-4852-81ee-88c40649b37a
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
|
@ -1,4 +1,4 @@
|
||||
uuid: e40f6f27-096f-4d03-a34f-afb8ae8be371
|
||||
uuid: 4f06f619-a8a0-4543-9165-3d66af1aa722
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
|
@ -1,4 +1,4 @@
|
||||
uuid: ce8a651c-fe72-4dad-b0c1-7661845c9ad2
|
||||
uuid: 897e00b7-08f2-4cbe-9ff1-cfb8a085ae4d
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
|
@ -1,4 +1,4 @@
|
||||
uuid: 8844be88-0ac5-4855-82ff-04b601da338f
|
||||
uuid: e59d3b15-98fa-499e-b7b8-9988f4176cd8
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
|
@ -1,4 +1,4 @@
|
||||
uuid: 042a1da3-e723-451c-91ba-d3770e0e5071
|
||||
uuid: b0e9db0b-3391-42d4-a80f-29ca99b706f2
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
|
@ -4,6 +4,7 @@ status: true
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.field_comparatifs_associes
|
||||
- field.storage.node.field_dates_actu
|
||||
- field.storage.node.field_diaporama
|
||||
- field.storage.node.field_image
|
||||
- field.storage.node.field_memo
|
||||
@ -33,6 +34,7 @@ dependencies:
|
||||
- entity_reference_revisions
|
||||
- image
|
||||
- node
|
||||
- smart_date
|
||||
- taxonomy
|
||||
- user
|
||||
_core:
|
||||
@ -89,12 +91,15 @@ display:
|
||||
node_bulk_form: node_bulk_form
|
||||
field_image: field_image
|
||||
title: title
|
||||
field_sous_titre: title
|
||||
operations: title
|
||||
field_programme: field_programme
|
||||
field_projet: field_projet
|
||||
field_theme: field_theme
|
||||
field_dates_actu: field_dates_actu
|
||||
field_dates_actu_value: field_dates_actu_value
|
||||
field_dates_actu_end_value: field_dates_actu_value
|
||||
status: status
|
||||
promote: promote
|
||||
changed: changed
|
||||
field_memo: field_memo
|
||||
info:
|
||||
@ -117,13 +122,6 @@ display:
|
||||
separator: '<br/>'
|
||||
empty_column: false
|
||||
responsive: ''
|
||||
field_sous_titre:
|
||||
sortable: false
|
||||
default_sort_order: asc
|
||||
align: ''
|
||||
separator: ''
|
||||
empty_column: false
|
||||
responsive: ''
|
||||
operations:
|
||||
align: ''
|
||||
separator: ''
|
||||
@ -150,6 +148,25 @@ display:
|
||||
separator: ''
|
||||
empty_column: false
|
||||
responsive: ''
|
||||
field_dates_actu:
|
||||
align: ''
|
||||
separator: ''
|
||||
empty_column: false
|
||||
responsive: ''
|
||||
field_dates_actu_value:
|
||||
sortable: true
|
||||
default_sort_order: asc
|
||||
align: ''
|
||||
separator: '<br/>'
|
||||
empty_column: false
|
||||
responsive: ''
|
||||
field_dates_actu_end_value:
|
||||
sortable: false
|
||||
default_sort_order: asc
|
||||
align: ''
|
||||
separator: ''
|
||||
empty_column: false
|
||||
responsive: ''
|
||||
status:
|
||||
sortable: true
|
||||
default_sort_order: asc
|
||||
@ -157,6 +174,13 @@ display:
|
||||
separator: ''
|
||||
empty_column: false
|
||||
responsive: ''
|
||||
promote:
|
||||
sortable: false
|
||||
default_sort_order: asc
|
||||
align: ''
|
||||
separator: ''
|
||||
empty_column: false
|
||||
responsive: ''
|
||||
changed:
|
||||
sortable: true
|
||||
default_sort_order: desc
|
||||
@ -5152,69 +5176,6 @@ display:
|
||||
settings:
|
||||
link_to_entity: true
|
||||
plugin_id: field
|
||||
field_type_de_ressource:
|
||||
id: field_type_de_ressource
|
||||
table: node__field_type_de_ressource
|
||||
field: field_type_de_ressource
|
||||
relationship: none
|
||||
group_type: group
|
||||
admin_label: ''
|
||||
label: 'Type de ressource'
|
||||
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
|
||||
operations:
|
||||
id: operations
|
||||
table: node
|
||||
@ -5265,6 +5226,72 @@ display:
|
||||
hide_alter_empty: true
|
||||
destination: true
|
||||
plugin_id: entity_operations
|
||||
field_dates_actu:
|
||||
id: field_dates_actu
|
||||
table: node__field_dates_actu
|
||||
field: field_dates_actu
|
||||
relationship: none
|
||||
group_type: group
|
||||
admin_label: ''
|
||||
label: 'Dates actu'
|
||||
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: smartdate_duration
|
||||
settings:
|
||||
timezone_override: ''
|
||||
format: date_only
|
||||
force_chronological: 0
|
||||
add_classes: 0
|
||||
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
|
||||
field_programme:
|
||||
id: field_programme
|
||||
table: node__field_programme
|
||||
@ -5454,77 +5481,36 @@ display:
|
||||
separator: ', '
|
||||
field_api_classes: false
|
||||
plugin_id: field
|
||||
field_ressources_liees:
|
||||
id: field_ressources_liees
|
||||
table: node__field_ressources_liees
|
||||
field: field_ressources_liees
|
||||
relationship: none
|
||||
group_type: group
|
||||
admin_label: ''
|
||||
label: Ressources
|
||||
status:
|
||||
id: status
|
||||
table: node_field_data
|
||||
field: status
|
||||
label: État
|
||||
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
|
||||
type: boolean
|
||||
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: ul
|
||||
separator: ', '
|
||||
field_api_classes: false
|
||||
format: custom
|
||||
format_custom_true: Publié
|
||||
format_custom_false: 'Non publié'
|
||||
plugin_id: field
|
||||
field_poid:
|
||||
id: field_poid
|
||||
table: node__field_poid
|
||||
field: field_poid
|
||||
entity_type: node
|
||||
entity_field: status
|
||||
promote:
|
||||
id: promote
|
||||
table: node_field_data
|
||||
field: promote
|
||||
relationship: none
|
||||
group_type: group
|
||||
admin_label: ''
|
||||
label: Poid
|
||||
label: Home
|
||||
exclude: false
|
||||
alter:
|
||||
alter_text: false
|
||||
@ -5566,10 +5552,11 @@ display:
|
||||
empty_zero: false
|
||||
hide_alter_empty: true
|
||||
click_sort_column: value
|
||||
type: number_integer
|
||||
type: boolean
|
||||
settings:
|
||||
thousand_separator: ''
|
||||
prefix_suffix: true
|
||||
format: unicode-yes-no
|
||||
format_custom_true: ''
|
||||
format_custom_false: ''
|
||||
group_column: value
|
||||
group_columns: { }
|
||||
group_rows: true
|
||||
@ -5580,29 +5567,9 @@ display:
|
||||
multi_type: separator
|
||||
separator: ', '
|
||||
field_api_classes: false
|
||||
plugin_id: field
|
||||
status:
|
||||
id: status
|
||||
table: node_field_data
|
||||
field: status
|
||||
label: État
|
||||
exclude: false
|
||||
alter:
|
||||
alter_text: false
|
||||
element_class: ''
|
||||
element_default_classes: true
|
||||
empty: ''
|
||||
hide_empty: false
|
||||
empty_zero: false
|
||||
hide_alter_empty: true
|
||||
type: boolean
|
||||
settings:
|
||||
format: custom
|
||||
format_custom_true: Publié
|
||||
format_custom_false: 'Non publié'
|
||||
plugin_id: field
|
||||
entity_type: node
|
||||
entity_field: status
|
||||
entity_field: promote
|
||||
plugin_id: field
|
||||
changed:
|
||||
id: changed
|
||||
table: node_field_data
|
||||
@ -5703,11 +5670,9 @@ display:
|
||||
- user.permissions
|
||||
max-age: 0
|
||||
tags:
|
||||
- 'config:field.storage.node.field_dates_actu'
|
||||
- 'config:field.storage.node.field_image'
|
||||
- 'config:field.storage.node.field_memo'
|
||||
- 'config:field.storage.node.field_poid'
|
||||
- 'config:field.storage.node.field_programme'
|
||||
- 'config:field.storage.node.field_projet'
|
||||
- 'config:field.storage.node.field_ressources_liees'
|
||||
- 'config:field.storage.node.field_theme'
|
||||
- 'config:field.storage.node.field_type_de_ressource'
|
||||
|
@ -0,0 +1,121 @@
|
||||
id: d7_node_actu
|
||||
label: Node actu
|
||||
migration_group: popsu
|
||||
audit: true
|
||||
migration_tags:
|
||||
- Drupal 7
|
||||
- Content
|
||||
- Popsu
|
||||
|
||||
source:
|
||||
plugin: d7_node_actu
|
||||
batch_size: 500
|
||||
# high_water_property:
|
||||
# name: changed
|
||||
# alias: n
|
||||
|
||||
destination:
|
||||
plugin: entity:node
|
||||
|
||||
process:
|
||||
# nid: nid
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: actualite
|
||||
created: created
|
||||
changed: changed
|
||||
|
||||
uid:
|
||||
plugin: default_value
|
||||
default_value: 34
|
||||
|
||||
title: title
|
||||
|
||||
field_sous_titre: field_popsu_actu_soustitre
|
||||
|
||||
promote:
|
||||
plugin: default_value
|
||||
default_value: 0
|
||||
source: field_popsu_actu_enhome
|
||||
|
||||
# https://understanddrupal.com/articles/migrating-dates-drupal
|
||||
# 'field_date/value':
|
||||
# plugin: format_date
|
||||
# source: field_popsu_actu_date
|
||||
# from_format: 'Y-m-j H:i:s'
|
||||
# to_format: 'Y-m-d\TH:i:s'
|
||||
# 'field_date/end_value':
|
||||
# plugin: format_date
|
||||
# source: field_popsu_actu_date_fin
|
||||
# from_format: 'Y-m-j H:i:s'
|
||||
# to_format: 'Y-m-d\TH:i:s'
|
||||
|
||||
field_dates_actu:
|
||||
-
|
||||
plugin: skip_on_empty
|
||||
method: process
|
||||
source: field_date
|
||||
-
|
||||
plugin: sub_process
|
||||
# source: field_date
|
||||
process:
|
||||
value:
|
||||
# format_date was not working, converting date to timestamp on prepare_row
|
||||
plugin: format_date
|
||||
from_format: 'Y-m-d H:i:s'
|
||||
to_format: 'Y-m-d\TH:i:s'
|
||||
# \TH:i:s
|
||||
source: value
|
||||
end_value:
|
||||
plugin: format_date
|
||||
from_format: 'Y-m-d H:i:s'
|
||||
to_format: 'Y-m-d\TH:i:s'
|
||||
source: end
|
||||
# duration: duration
|
||||
timezone:
|
||||
plugin: default_value
|
||||
default_value: ""
|
||||
# settings:
|
||||
# validate_format: false
|
||||
|
||||
body:
|
||||
plugin: sub_process
|
||||
source: field_popsu_actu_body
|
||||
process:
|
||||
value: value
|
||||
summary: summary
|
||||
format:
|
||||
plugin: default_value
|
||||
default_value: wysiwyg
|
||||
|
||||
field_fichier:
|
||||
plugin: sub_process
|
||||
source: field_popsu_actu_attachment
|
||||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
migration: d7_allpublicfiles
|
||||
source: fid
|
||||
no_stub: true
|
||||
display: display
|
||||
description: description
|
||||
|
||||
field_image:
|
||||
plugin: sub_process
|
||||
source: field_popsu_actu_image
|
||||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
migration: d7_allpublicfiles
|
||||
source: fid
|
||||
no_stub: true
|
||||
alt: alt
|
||||
title: title
|
||||
|
||||
|
||||
|
||||
field_memo: field_memo
|
||||
|
||||
migration_dependencies:
|
||||
required:
|
||||
- d7_allpublicfiles
|
@ -107,5 +107,3 @@ process:
|
||||
migration_dependencies:
|
||||
required:
|
||||
- d7_allpublicfiles
|
||||
- d7_users
|
||||
- d7_taxonomy_term_type_theme
|
||||
|
@ -0,0 +1,187 @@
|
||||
<?php
|
||||
namespace Drupal\popsu_migrate\Plugin\migrate\source;
|
||||
|
||||
use Drupal\Core\Extension\ModuleHandlerInterface;
|
||||
use Drupal\migrate\Row;
|
||||
use Drupal\migrate_drupal\Plugin\migrate\source\d7\FieldableEntity;
|
||||
use Drupal\Core\Database\Query\SelectInterface;
|
||||
use Drupal\Core\Entity\EntityTypeManagerInterface;
|
||||
use Drupal\Core\Extension\ModuleHandler;
|
||||
use Drupal\Core\State\StateInterface;
|
||||
use Drupal\migrate\Plugin\MigrationInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
|
||||
use Drush\Drush;
|
||||
use Drupal\paragraphs\Entity\Paragraph;
|
||||
|
||||
// use Drupal\popsu_migrate\Plugin\migrate\source\D7Programme;
|
||||
|
||||
/**
|
||||
* Drupal 7 node source from database.
|
||||
*
|
||||
* @MigrateSource(
|
||||
* id = "d7_node_actu",
|
||||
* source_module = "node"
|
||||
* )
|
||||
*/
|
||||
class D7NodeActu extends FieldableEntity {
|
||||
/**
|
||||
* The module handler.
|
||||
*
|
||||
* @var \Drupal\Core\Extension\ModuleHandlerInterface
|
||||
*/
|
||||
protected $moduleHandler;
|
||||
|
||||
/**
|
||||
* The logger channel.
|
||||
*
|
||||
* @var \Drupal\Core\Logger\LoggerChannelInterface
|
||||
*/
|
||||
protected $logger;
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, StateInterface $state, EntityTypeManagerInterface $entity_manager, ModuleHandlerInterface $module_handler,LoggerChannelFactoryInterface $loggerFactory) {
|
||||
parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $state, $entity_manager);
|
||||
$this->moduleHandler = $module_handler;
|
||||
$this->logger = $loggerFactory->get('popsu_migration');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) {
|
||||
return new static(
|
||||
$configuration,
|
||||
$plugin_id,
|
||||
$plugin_definition,
|
||||
$migration,
|
||||
$container->get('state'),
|
||||
$container->get('entity_type.manager'),
|
||||
$container->get('module_handler'),
|
||||
$container->get('logger.factory')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* The join options between the node and the node_revisions table.
|
||||
*/
|
||||
const JOIN = 'n.vid = nr.vid';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function query() {
|
||||
// Select node in its last revision.
|
||||
$query = $this->select('node_revision', 'nr')
|
||||
->fields('n', [
|
||||
'nid',
|
||||
'type',
|
||||
'uid',
|
||||
'language',
|
||||
'status',
|
||||
'created',
|
||||
'changed',
|
||||
])
|
||||
->fields('nr', [
|
||||
'vid',
|
||||
'title',
|
||||
'log',
|
||||
'timestamp',
|
||||
])
|
||||
->orderBy('type', 'DESC');
|
||||
|
||||
$query->addField('n', 'uid', 'node_uid');
|
||||
$query->addField('nr', 'uid', 'revision_uid');
|
||||
$query->innerJoin('node', 'n', static::JOIN);
|
||||
|
||||
$query->condition('n.type', ['popsu_actu'], 'IN');
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function prepareRow(Row $row) {
|
||||
$nid = $row->getSourceProperty('nid');
|
||||
$vid = $row->getSourceProperty('vid');
|
||||
$type = $row->getSourceProperty('type');
|
||||
$title = $row->getSourceProperty('title');
|
||||
Drush::output()->writeln('- - - - ' . $title . ' ('.$nid.')'. ' ['.$type.']' . '- - - - ');
|
||||
|
||||
$memo = '';
|
||||
$memo .= "#migration : old nid = ".$nid."\n";
|
||||
$memo .= "#migration : old content type = ".$type."\n";
|
||||
|
||||
// Get Field API field values.
|
||||
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);
|
||||
}
|
||||
|
||||
$field_date = array();
|
||||
if ($date_start = $row->getSourceProperty('field_popsu_actu_date')) {
|
||||
// Drush::output()->writeln(dump($date_start));
|
||||
// $field_date['value'] = strtotime(substr($date_start[0]['value'], 0, 10));
|
||||
$field_date['value'] = $date_start[0]['value'];
|
||||
}
|
||||
if ($date_end = $row->getSourceProperty('field_popsu_actu_date_fin')) {
|
||||
// Drush::output()->writeln(dump($date_end));
|
||||
$field_date['end'] = $date_end[0]['value'];
|
||||
}
|
||||
if (!empty($field_date)) {
|
||||
// $field_date['duration'] = $field_date['end'] - $field_date['value'];
|
||||
// Drush::output()->writeln(dump($field_date));
|
||||
$row->setSourceProperty('field_date', array($field_date));
|
||||
}
|
||||
|
||||
|
||||
// record migration errors in field_memo
|
||||
if(isset($memo)){
|
||||
$field_memo = array(
|
||||
array(
|
||||
'value' => $memo
|
||||
)
|
||||
);
|
||||
$row->setSourceProperty('field_memo', $field_memo);
|
||||
}
|
||||
|
||||
return parent::prepareRow($row);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function fields() {
|
||||
$fields = [
|
||||
'nid' => $this->t('Node ID'),
|
||||
'type' => $this->t('Type'),
|
||||
'title' => $this->t('Title'),
|
||||
'node_uid' => $this->t('Node authored by (uid)'),
|
||||
'revision_uid' => $this->t('Revision authored by (uid)'),
|
||||
'created' => $this->t('Created timestamp'),
|
||||
'changed' => $this->t('Modified timestamp'),
|
||||
'status' => $this->t('Published'),
|
||||
'promote' => $this->t('Promoted to front page'),
|
||||
'sticky' => $this->t('Sticky at top of lists'),
|
||||
'revision' => $this->t('Create new revision'),
|
||||
'language' => $this->t('Language (fr, en, ...)'),
|
||||
'tnid' => $this->t('The translation set id for this node'),
|
||||
'timestamp' => $this->t('The timestamp the latest revision of this node was created.'),
|
||||
];
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getIds() {
|
||||
$ids['nid']['type'] = 'integer';
|
||||
$ids['nid']['alias'] = 'n';
|
||||
return $ids;
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user