Skip to content

Commit bdc8af6

Browse files
committed
Merge branch 'develop' into staging
2 parents 099e2ab + 4f54b36 commit bdc8af6

38 files changed

+1113
-104
lines changed

.docker/os2web/build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ if [ "$2" = "--push" ]; then
2121
if [ $? -eq 0 ]; then
2222
echo "Pushing image to docker hub ..."
2323
docker push dkbellcom/os2web8:$1
24-
echo "Check your image here https://hub.docker.com/repository/docker/dkbellcom/os2web8/tag"
24+
docker rmi dkbellcom/os2web8:$1
25+
echo "Image dkbellcom/os2web8:$1 was remove from this machine"
26+
echo "Check your image here https://hub.docker.com/r/dkbellcom/os2web8/tags"
2527
else
2628
echo "Image is not pushed to docker hub :("
2729
fi;

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
"drupal/stage_file_proxy": "^1.0",
113113
"drupal/upgrade_rector": "^1.0@alpha",
114114
"drupal/upgrade_status": "^3.5",
115+
"drupal/webform": "^6.1",
115116
"drupal/workbench": "^1.3",
116117
"drush/drush": "^9.7.1 | ^10.0.0",
117118
"mglaman/drupal-check": "^1.1",
@@ -131,6 +132,7 @@
131132
"os2web/os2web_news": "dev-master",
132133
"os2web/os2web_pagebuilder": "dev-master",
133134
"os2web/os2web_person_information": "dev-master",
135+
"os2web/os2web_postlister": "dev-master",
134136
"os2web/os2web_rest_api": "0.*",
135137
"os2web/os2web_search": "dev-master",
136138
"os2web/os2web_spotbox": "dev-master",
@@ -206,6 +208,9 @@
206208
"drupal/printable": {
207209
"3214729 PDF filename is generated with it's location" : "https://git.drupalcode.org/issue/printable-3214729/-/commit/cbc98dbe864f82b4cc1da110d88097d0c4740bb9.patch",
208210
"#3193531, Drupal 9 errors from submodule": "https://git.drupalcode.org/issue/printable-3193531/-/commit/9b4d5fa8b6a713da671ab3143c8580fce45ca6fb.diff"
211+
},
212+
"drupal/scheduler_content_moderation_integration" : {
213+
"Widget error when field is overridden - undefined offset 0 in $form['publish_state']" : "https://www.drupal.org/files/issues/2020-06-30/3077147-28.patch"
209214
}
210215
}
211216
}

composer.lock

Lines changed: 221 additions & 73 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Ringsted D7 Migration module
2+
3+
## Module purpose
4+
5+
The aim of this module is to provide migration of the content from Ringsted.dk D7 version to OS2Web D8.
6+
7+
## Install
8+
9+
1. Module is part of the repository, and can be installed:
10+
```
11+
drush en ringsted_d7_migration
12+
```
13+
14+
2. Create separate Database and import D7 version of the site there. Database must be defined in **settings.php** file (next to the default one):
15+
```
16+
$databases['default']['default'] = array (
17+
...
18+
);
19+
20+
// Describe migration database.
21+
$databases['migrate']['default'] = array (
22+
'database' => '[db_name]',
23+
'username' => '[db_user]',
24+
'password' => '[db_password]',
25+
'prefix' => '',
26+
'host' => '[db_host]',
27+
'port' => '',
28+
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
29+
'driver' => 'mysql',
30+
);
31+
```
32+
33+
## Migrate quick run
34+
Run the entire migration process with single command:
35+
```
36+
cd web
37+
sh ./modules/custom/ringsted_d7_migration/scripts/migrate.sh
38+
```
39+
40+
## Migrate process details for manual run
41+
42+
The recommended usage migrate process is via Drush:
43+
44+
Read more about the Drush commands for Migrate API on [Migrate tools](https://www.drupal.org/project/migrate_tool).
45+
46+
* Migrate section terms:
47+
```
48+
drush migrate:import ringsted_d7_taxonomy_section
49+
```
50+
* Migrate News:
51+
```
52+
drush migrate:import ringsted_d7_node_news
53+
```
54+
* Migrate Postlister:
55+
```
56+
drush migrate:import ringsted_d7_node_postlister
57+
```
58+
59+
## Useful hints
60+
61+
When changing migration definition in **.yml** files, import the changes with:
62+
```
63+
drush cim --partial --source=modules/custom/ringsted_d7_migration/config/install -y
64+
```
65+
66+
If migration stopped with an error, it might need to be reset, e.g.:
67+
```
68+
drush migrate:reset [migation_name]
69+
```
70+
71+
Instead of migrating/importing all entities, it is faster to do development with importing only few entities. Use **limit** flag:
72+
```
73+
drush migrate:import [migation_name] --limit=5
74+
```
75+
76+
By default each migration run will import only new entities, but sometimes you want to overwrite what you already have instead of importing new ones. That can be done with **update** flag:
77+
```
78+
drush migrate:import [migation_name] --update
79+
```
80+
81+
Use it with **limit** flag to force update previously imported entities:
82+
```
83+
drush migrate:import [migation_name] --limit=5 --update
84+
```
85+
86+
## Contribution
87+
88+
Project is opened for new features and os course bugfixes.
89+
If you have any suggestion or you found a bug in project, you are very welcome
90+
to create an issue in github repository issue tracker.
91+
For issue description there is expected that you will provide clear and
92+
sufficient information about your feature request or bug report.
93+
94+
### Code review policy
95+
See [OS2Web code review policy](https://github.com/OS2Web/docs#code-review)
96+
97+
### Git name convention
98+
See [OS2Web git name convention](https://github.com/OS2Web/docs#git-guideline)
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
id: ringsted_d7_node_news
2+
label: Ringsted D7 Node News
3+
migration_group: ringsted_d7
4+
migration_tags:
5+
- Drupal 7
6+
- Content
7+
deriver: Drupal\node\Plugin\migrate\D7NodeDeriver
8+
source:
9+
plugin: d7_node
10+
node_type: news
11+
track_changes: true
12+
process:
13+
# If you are using this file to build a custom migration consider removing
14+
# the nid and vid fields to allow incremental migrations.
15+
# In D7, nodes always have a tnid, but it's zero for untranslated nodes.
16+
# We normalize it to equal the nid in that case.
17+
# @see \Drupal\node\Plugin\migrate\source\d7\Node::prepareRow().
18+
type:
19+
plugin: default_value
20+
default_value: os2web_news
21+
langcode:
22+
plugin: default_value
23+
source: language
24+
default_value: 'und'
25+
title: title
26+
field_os2web_news_heading: title
27+
status: status
28+
created: created
29+
changed: changed
30+
#promote: promote
31+
sticky: sticky
32+
field_os2web_news_article_author: field_author
33+
field_os2web_news_article_date:
34+
- plugin: skip_row_if_old_news
35+
index: 0
36+
source: field_date
37+
- plugin: sub_process
38+
source: field_date
39+
process:
40+
value:
41+
plugin: format_date
42+
from_format: 'Y-m-d H:i:s'
43+
to_format: 'Y-m-d\TH:i:s'
44+
from_timezone: 'Europe/Copenhagen'
45+
source: value
46+
field_os2web_news_description:
47+
- plugin: sub_process
48+
source: body
49+
process:
50+
value: value
51+
format:
52+
plugin: default_value
53+
default_value: 'wysiwyg_tekst'
54+
field_os2web_news_section:
55+
- plugin: sub_process
56+
source: field_taxonomy_subject_area
57+
process:
58+
target_id:
59+
plugin: migration_lookup
60+
migration: ringsted_d7_taxonomy_section
61+
source: tid
62+
field_os2web_news_intro: field_teaser
63+
migrate_file_url_source:
64+
- plugin: extract
65+
source: field_image_thumbnail
66+
default: ''
67+
index:
68+
- 0
69+
- plugin: callback
70+
callable:
71+
- 'Drupal\ringsted_d7_migration\Utility\MigrationHelper'
72+
- getFileDownloadUrl
73+
migrate_file_url_destination:
74+
- plugin: extract
75+
source: field_image_thumbnail
76+
default: ''
77+
index:
78+
- 0
79+
- plugin: callback
80+
callable:
81+
- 'Drupal\ringsted_d7_migration\Utility\MigrationHelper'
82+
- generateFileDestinationPath
83+
migrate_file_fid:
84+
- plugin: skip_on_empty
85+
method: process
86+
source: '@migrate_file_url_source'
87+
message: 'Image is missing'
88+
- plugin: file_copy
89+
source:
90+
- '@migrate_file_url_source'
91+
- '@migrate_file_url_destination'
92+
- plugin: callback
93+
callable:
94+
- 'Drupal\ringsted_d7_migration\Utility\MigrationHelper'
95+
- createFileManaged
96+
field_os2web_news_primaryimage/target_id: '@migrate_file_fid'
97+
field_os2web_news_primaryimage/alt: field_image_description/0/value
98+
destination:
99+
plugin: entity:node
100+
migration_dependencies:
101+
required:
102+
- ringsted_d7_taxonomy_section
103+
optional: {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
id: ringsted_d7_node_postlister
2+
label: Ringsted D7 Node Postlister
3+
migration_group: ringsted_d7
4+
migration_tags:
5+
- Drupal 7
6+
- Content
7+
deriver: Drupal\node\Plugin\migrate\D7NodeDeriver
8+
source:
9+
plugin: d7_node
10+
node_type: postliste
11+
track_changes: true
12+
process:
13+
# If you are using this file to build a custom migration consider removing
14+
# the nid and vid fields to allow incremental migrations.
15+
# In D7, nodes always have a tnid, but it's zero for untranslated nodes.
16+
# We normalize it to equal the nid in that case.
17+
# @see \Drupal\node\Plugin\migrate\source\d7\Node::prepareRow().
18+
type:
19+
plugin: default_value
20+
default_value: os2web_postlister
21+
langcode:
22+
plugin: default_value
23+
source: language
24+
default_value: 'und'
25+
title: title
26+
field_os2web_postlister_heading: field_teaser
27+
status: status
28+
created:
29+
plugin: skip_row_if_old
30+
skipOlderThanDate: "2021-01-01"
31+
source: created
32+
message: "Skipped old content"
33+
changed: changed
34+
#promote: promote
35+
sticky: sticky
36+
field_os2web_postlister_descript:
37+
- plugin: sub_process
38+
source: body
39+
process:
40+
value: value
41+
format:
42+
plugin: default_value
43+
default_value: 'wysiwyg_tekst'
44+
field_os2web_postlister_kle/target_id:
45+
- plugin: callback
46+
callable:
47+
- 'Drupal\ringsted_d7_migration\Utility\MigrationHelper'
48+
- findPostlisterKleTerm
49+
source: nid
50+
field_os2web_postlister_section:
51+
- plugin: sub_process
52+
source: field_taxonomy_subject_area
53+
process:
54+
target_id:
55+
plugin: migration_lookup
56+
migration: ringsted_d7_taxonomy_section
57+
source: tid
58+
destination:
59+
plugin: entity:node
60+
migration_dependencies:
61+
required:
62+
- ringsted_d7_taxonomy_section
63+
optional: {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
id: ringsted_d7_taxonomy_section
2+
label: Ballerup D7 Taxonomy section
3+
migration_group: ringsted_d7
4+
migration_tags:
5+
- Drupal 7
6+
deriver: Drupal\taxonomy\Plugin\migrate\D7TaxonomyTermDeriver
7+
source:
8+
plugin: d7_taxonomy_term
9+
bundle: subject_area
10+
track_changes: true
11+
process:
12+
vid:
13+
plugin: default_value
14+
default_value: os2web_sektion
15+
name: name
16+
weight: weight
17+
# Only attempt to stub real (non-zero) parents.
18+
parent_id:
19+
-
20+
plugin: skip_on_empty
21+
method: process
22+
source: parent
23+
-
24+
plugin: migration_lookup
25+
migration: ringsted_d7_taxonomy_section
26+
parent:
27+
plugin: default_value
28+
default_value: 0
29+
source: '@parent_id'
30+
changed: timestamp
31+
langcode: language
32+
destination:
33+
plugin: entity:taxonomy_term
34+
migration_dependencies:
35+
required: {}
36+
optional: {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
langcode: da
2+
status: true
3+
dependencies:
4+
enforced:
5+
module:
6+
- ringsted_d7_migration
7+
id: ringsted_d7
8+
label: 'Ringsted D7 Content'
9+
description: 'Ringsted.dk D7 content import'
10+
source_type: 'Ringsted.dk Database'
11+
module: null
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Ringsted.dk D7 Migration
2+
description: Custom migration module for migrating data from Ringsted.dk Drupal 7 site.
3+
package: 'Bellcom'
4+
type: module
5+
core: 8.x
6+
core_version_requirement: ^8 || ^9
7+
dependencies:
8+
- migrate
9+
- migrate_drupal
10+
- migrate_plus
11+
- os2web_news
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php

0 commit comments

Comments
 (0)