Skip to content

Commit cebfe80

Browse files
committed
BKDK-469 - Change gallery slide headers
1 parent d2f3ed8 commit cebfe80

File tree

2 files changed

+129
-60
lines changed

2 files changed

+129
-60
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
3+
/**
4+
* This script disables related links on migrated content.
5+
* paragraph
6+
*
7+
* See task: https://os2web.atlassian.net/browse/BKDK-469
8+
*/
9+
10+
use Drupal\node\Entity\Node;
11+
use Drupal\node\NodeInterface;
12+
13+
$database = \Drupal::database();
14+
15+
// Getting all gallery slide pages.
16+
$node_migrate_tables = [
17+
'migrate_map_ballerup_d7_node_gallery_slide',
18+
];
19+
20+
$migrate_nids = [];
21+
foreach ($node_migrate_tables as $table) {
22+
$table_nids = $database->select($table)->fields($table, [
23+
'destid1',
24+
])
25+
->isNotNull('destid1')
26+
->execute()
27+
->fetchCol();
28+
29+
$migrate_nids += $table_nids;
30+
}
31+
32+
print_r("Node to update: " . count($migrate_nids));
33+
print_r(PHP_EOL);
34+
35+
$updated_count = 0;
36+
foreach ($migrate_nids as $nid) {
37+
$node = Node::load($nid);
38+
if ($node instanceof NodeInterface) {
39+
$title = $node->getTitle();
40+
$heading = $node->field_os2web_page_heading->value;
41+
42+
if (strcasecmp($title, $heading) !== 0) {
43+
$node->field_os2web_page_heading->value = $title;
44+
$node->save();
45+
$updated_count++;
46+
}
47+
}
48+
}
49+
50+
print_r("Total nodes updated: $updated_count");
51+
print_r(PHP_EOL);
Lines changed: 78 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,80 @@
11
#!/bin/sh
22

3-
echo "Importing new import configuration"
4-
drush cim --partial --source=modules/custom/ballerup_d7_migration/config/install -y
5-
echo "Configuration imported"
6-
7-
echo "Migration users - START"
8-
drush migrate:import ballerup_d7_user --update
9-
echo "Migration users - END"
10-
11-
echo "Migration ballerup_d7_taxonomy_section - START"
12-
drush migrate:import ballerup_d7_taxonomy_section --update
13-
echo "Migration ballerup_d7_taxonomy_section - END"
14-
15-
echo "Migration ballerup_d7_taxonomy_tags - START"
16-
drush migrate:import ballerup_d7_taxonomy_tags --update
17-
echo "Migration ballerup_d7_taxonomy_tags - END"
18-
19-
echo "Migration os2web_borgerdk_articles_import - START"
20-
drush migrate:import os2web_borgerdk_articles_import --update
21-
echo "Migration os2web_borgerdk_articles_import - END"
22-
23-
echo "Migration ballerup_d7_contact_box - START"
24-
drush migrate:import ballerup_d7_contact_box --update
25-
echo "Migration ballerup_d7_contact_box - END"
26-
27-
echo "Migration ballerup_d7_paragraph_iframe - START"
28-
drush migrate:import ballerup_d7_paragraph_iframe --update
29-
echo "Migration ballerup_d7_paragraph_iframe - END"
30-
31-
echo "Migration ballerup_d7_node_gallery_slide - START"
32-
drush migrate:import ballerup_d7_node_gallery_slide --update
33-
echo "Migration ballerup_d7_node_gallery_slide - END"
34-
35-
echo "Migration ballerup_d7_node_institution_page - START"
36-
drush migrate:import ballerup_d7_node_institution_page --update
37-
echo "Migration ballerup_d7_node_institution_page - END"
38-
39-
echo "Migration ballerup_d7_node_news - START"
40-
drush migrate:import ballerup_d7_node_news --update
41-
echo "Migration ballerup_d7_node_news - END"
42-
43-
echo "Migration ballerup_d7_paragraph_accordion - START"
44-
drush migrate:import ballerup_d7_paragraph_accordion --update
45-
echo "Migration ballerup_d7_paragraph_accordion - END"
46-
47-
echo "Migration ballerup_d7_node_indholdside - START"
48-
drush migrate:import ballerup_d7_node_indholdside --update
49-
echo "Migration ballerup_d7_node_indholdside - END"
50-
51-
echo "Execuing custom script [1/5] - Fix publish status"
52-
drush scr modules/custom/ballerup_d7_migration/scripts/migrate_fix_publish_status.php
53-
echo "Execuing custom script [2/5] - Remove inline picutres"
54-
drush scr modules/custom/ballerup_d7_migration/scripts/remove_inline_pictures.php
55-
echo "Execuing custom script [3/5] - Remove node header duplicates (content pages using Borger.dk article)"
56-
drush scr modules/custom/ballerup_d7_migration/scripts/BKDK-401-migrate_remove_page_borgerdk_body.php
57-
echo "Execuing custom script [4/5] - Disable related links block on migrated nodes"
58-
drush scr modules/custom/ballerup_d7_migration/scripts/BKDK-432-migrate_disable_related_links.php
59-
echo "Execuing custom script [5/5] - Updated section pages"
60-
drush scr modules/custom/ballerup_d7_migration/scripts/BKDK-399-update_section_pages.php
61-
62-
echo "Migration complete visit URL '/admin/config/system/delete-orphans' to delete the orphaned paragraphs"
3+
echo "Migration is disabled"
4+
5+
#echo "Importing new import configuration"
6+
#drush cim --partial --source=modules/custom/ballerup_d7_migration/config/install -y
7+
#echo "Configuration imported"
8+
#
9+
#echo "Migration users - START"
10+
#drush migrate:import ballerup_d7_user --update
11+
#echo "Migration users - END"
12+
#
13+
#echo "Migration ballerup_d7_taxonomy_section - START"
14+
#drush migrate:import ballerup_d7_taxonomy_section --update
15+
#echo "Migration ballerup_d7_taxonomy_section - END"
16+
#
17+
#echo "Migration ballerup_d7_taxonomy_tags - START"
18+
#drush migrate:import ballerup_d7_taxonomy_tags --update
19+
#echo "Migration ballerup_d7_taxonomy_tags - END"
20+
#
21+
#echo "Migration os2web_borgerdk_articles_import - START"
22+
#drush migrate:import os2web_borgerdk_articles_import --update
23+
#echo "Migration os2web_borgerdk_articles_import - END"
24+
#
25+
#echo "Migration ballerup_d7_contact_box - START"
26+
#drush migrate:import ballerup_d7_contact_box --update
27+
#echo "Migration ballerup_d7_contact_box - END"
28+
#
29+
#echo "Migration ballerup_d7_paragraph_iframe - START"
30+
#drush migrate:import ballerup_d7_paragraph_iframe --update
31+
#echo "Migration ballerup_d7_paragraph_iframe - END"
32+
#
33+
#echo "Migration ballerup_d7_node_gallery_slide - START"
34+
#drush migrate:import ballerup_d7_node_gallery_slide --update
35+
#echo "Migration ballerup_d7_node_gallery_slide - END"
36+
#
37+
#echo "Migration ballerup_d7_node_institution_page - START"
38+
#drush migrate:import ballerup_d7_node_institution_page --update
39+
#echo "Migration ballerup_d7_node_institution_page - END"
40+
#
41+
#echo "Migration ballerup_d7_node_news - START"
42+
#drush migrate:import ballerup_d7_node_news --update
43+
#echo "Migration ballerup_d7_node_news - END"
44+
#
45+
#echo "Migration ballerup_d7_paragraph_accordion - START"
46+
#drush migrate:import ballerup_d7_paragraph_accordion --update
47+
#echo "Migration ballerup_d7_paragraph_accordion - END"
48+
#
49+
#echo "Migration ballerup_d7_node_indholdside - START"
50+
#drush migrate:import ballerup_d7_node_indholdside --update
51+
#echo "Migration ballerup_d7_node_indholdside - END"
52+
#
53+
echo "Execuing custom script [1/6] - Fix publish status"
54+
#drush scr modules/custom/ballerup_d7_migration/scripts/migrate_fix_publish_status.php
55+
echo "Skipped"
56+
57+
echo "Execuing custom script [2/6] - Remove inline picutres"
58+
#drush scr modules/custom/ballerup_d7_migration/scripts/remove_inline_pictures.php
59+
echo "Skipped"
60+
61+
echo "Execuing custom script [3/6] - Remove node header duplicates (content pages using Borger.dk article)"
62+
#drush scr modules/custom/ballerup_d7_migration/scripts/BKDK-401-migrate_remove_page_borgerdk_body.php
63+
echo "Skipped"
64+
65+
echo "Execuing custom script [4/6] - Disable related links block on migrated nodes"
66+
#drush scr modules/custom/ballerup_d7_migration/scripts/BKDK-432-migrate_disable_related_links.php
67+
echo "Skipped"
68+
69+
echo "Execuing custom script [5/6] - Updated section pages"
70+
#drush scr modules/custom/ballerup_d7_migration/scripts/BKDK-399-update_section_pages.php
71+
echo "Skipped"
72+
73+
echo "Execuing custom script [5/6] - Updated section pages"
74+
#drush scr modules/custom/ballerup_d7_migration/scripts/BKDK-399-update_section_pages.php
75+
echo "Skipped"
76+
77+
echo "Execuing custom script [6/6] - Change gallery slide headers"
78+
drush scr modules/custom/ballerup_d7_migration/scripts/BKDK-469-change_gallery_slide_headers.php
79+
80+
#echo "Migration complete visit URL '/admin/config/system/delete-orphans' to delete the orphaned paragraphs"

0 commit comments

Comments
 (0)