Skip to content

Commit

Permalink
release(2.19.0): fix taxonomy migration ouitoulia/diagraphe#15
Browse files Browse the repository at this point in the history
  • Loading branch information
arturu committed Apr 13, 2024
1 parent def756d commit c204cf9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 10 deletions.
12 changes: 10 additions & 2 deletions config/install/migrate_plus.migration.demo_taxonomy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ source:
# track_changes: false

urls:
- 'https://ouitoulia.github.io/krene/demo/argomenti.json'
- 'https://ouitoulia.github.io/krene/demo/autori_editori.json'
- 'https://ouitoulia.github.io/krene/demo/tassonomia_argomenti.json'
- 'https://ouitoulia.github.io/krene/demo/tassonomia_autori_editori.json'
- 'https://ouitoulia.github.io/krene/demo/tassonomia_custom_override.json'

# An xpath-like selector corresponding to the items to be imported.
item_selector: data
Expand All @@ -54,6 +55,9 @@ source:
- name: weight
label: 'Il peso della voce di tassonomia'
selector: attributes/weight
- name: copertina
label: 'Immagine di copertina'
selector: relationships/copertina/data/id
- name: parent_id
label: 'Id del termine genitore della voce di tassonomia'
selector: relationships/parent/data/id
Expand Down Expand Up @@ -88,6 +92,10 @@ process:
- plugin: skip_on_empty
method: process
source: description
field_copertina:
plugin: skip_on_empty
source: copertina
method: process

destination:
plugin: entity:taxonomy_term
Expand Down
16 changes: 12 additions & 4 deletions config/install/migrate_plus.migration.taxonomy_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ source:
- name: parent_id
label: 'Id del termine genitore della voce di tassonomia'
selector: relationships/parent/data/id
- name: copertina
label: 'Immagine di copertina'
selector: relationships/copertina/data/id
- name: published
label: 'Se la voce è pubblicata o meno'
selector: attributes/published
Expand Down Expand Up @@ -100,10 +103,15 @@ process:
description/format:
- plugin: default_value
default_value: bootstrap_italia_2
status:
plugin: default_value
source: published
default_value: 1
field_copertina:
plugin: skip_on_empty
source: copertina
method: process
# Ho commentato questo campo per non sovrascrivere l'eventuale stato modificato
# status:
# plugin: default_value
# source: published
# default_value: 1

destination:
plugin: entity:taxonomy_term
Expand Down
16 changes: 12 additions & 4 deletions config/install/migrate_plus.migration.taxonomy_common_uuid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ source:
- name: parent_id
label: 'Id del termine genitore della voce di tassonomia'
selector: relationships/parent/data/id
- name: copertina
label: 'Immagine di copertina'
selector: relationships/copertina/data/id
- name: uuid
label: "L'UUID della voce"
selector: uuid
Expand Down Expand Up @@ -129,10 +132,15 @@ process:
description/format:
- plugin: default_value
default_value: bootstrap_italia_2
status:
plugin: default_value
source: published
default_value: 1
field_copertina:
plugin: skip_on_empty
source: copertina
method: process
# Ho commentato questo campo per non sovrascrivere l'eventuale stato modificato
# status:
# plugin: default_value
# source: published
# default_value: 1

destination:
plugin: entity:taxonomy_term
Expand Down

0 comments on commit c204cf9

Please sign in to comment.