-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(YALB-1550): add single_content_sync
This update allows exporting and importing of nodes, media, and taxonomy through either a graphical interface or through a drush command. Keep in mind that due to limitations of file size uploads with PHP, Pantheon, and Drupal, importing large amounts of data should be done via Drush. * Add single_content_sync module and enable it * Add custom bulk actions for exporting taxonomy and media in the same way as nodes * Add processors for types not handled by single_content_sync * Embed * Markup * SmartDate * ViewsBasicParams * Add custom admin views for exporting nodes, taxonomy, and media, accessible through Configuration->System->Export Nodes * Add ZipArchive patch * The open method has been deprecated, and a message appears displaying this when attempting to export via a zip file. This patch squelches this. This has been fixed in Drupal 10.1, but is still present in 9.5
- Loading branch information
1 parent
8651bc8
commit 7c6adff
Showing
29 changed files
with
2,699 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
web/profiles/custom/yalesites_profile/config/starterkit_config/.htaccess
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Deny all requests from Apache 2.4+. | ||
<IfModule mod_authz_core.c> | ||
Require all denied | ||
</IfModule> | ||
|
||
# Deny all requests from Apache 2.0-2.2. | ||
<IfModule !mod_authz_core.c> | ||
Deny from all | ||
</IfModule> | ||
|
||
# Turn off all options we don't need. | ||
Options -Indexes -ExecCGI -Includes -MultiViews | ||
|
||
# Set the catch-all handler to prevent scripts from being executed. | ||
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 | ||
<Files *> | ||
# Override the handler again if we're run later in the evaluation list. | ||
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 | ||
</Files> | ||
|
||
# If we know how to do it safely, disable the PHP engine entirely. | ||
<IfModule mod_php7.c> | ||
php_flag engine off | ||
</IfModule> | ||
<IfModule mod_php.c> | ||
php_flag engine off | ||
</IfModule> |
71 changes: 71 additions & 0 deletions
71
...tom/yalesites_profile/config/starterkit_config/migrate_plus.migration.ys_images_files.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
uuid: 9440b8ce-971f-47ff-bc8b-4a5fdbfba7ff | ||
langcode: en | ||
status: true | ||
dependencies: | ||
enforced: | ||
module: | ||
- ys_starterkit | ||
id: ys_images_files | ||
class: null | ||
field_plugin_method: null | ||
cck_plugin_method: null | ||
migration_tags: null | ||
migration_group: ys_starterkit | ||
label: 'Starterkit Images' | ||
source: | ||
plugin: url | ||
data_fetcher_plugin: file | ||
data_parser_plugin: json | ||
urls: | ||
- profiles/custom/yalesites_profile/modules/custom/ys_starterkit/content/images.json | ||
item_selector: /data/images | ||
fields: | ||
- | ||
name: image_id | ||
label: 'Image ID' | ||
selector: image_id | ||
- | ||
name: image_url | ||
label: 'Image URL' | ||
selector: image_url | ||
ids: | ||
image_id: | ||
type: integer | ||
constants: | ||
drupal_file_dest: 'public://starterkit/' | ||
process: | ||
destination_filename: | ||
- | ||
plugin: callback | ||
callable: basename | ||
source: image_url | ||
- | ||
plugin: skip_on_empty | ||
method: row | ||
message: 'Cannot import empty filename.' | ||
destination_full_path: | ||
- | ||
plugin: concat | ||
source: | ||
- constants/drupal_file_dest | ||
- '@destination_filename' | ||
- | ||
plugin: urlencode | ||
uri: | ||
- | ||
plugin: skip_on_empty | ||
method: process | ||
source: image_url | ||
- | ||
plugin: file_copy | ||
source: | ||
- image_url | ||
- '@destination_full_path' | ||
file_exists: rename | ||
move: false | ||
uid: | ||
plugin: default_value | ||
default_value: 1 | ||
destination: | ||
plugin: 'entity:file' | ||
migration_dependencies: { } |
66 changes: 66 additions & 0 deletions
66
...tom/yalesites_profile/config/starterkit_config/migrate_plus.migration.ys_images_media.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
uuid: 39d4e56f-4151-4461-b4d0-113dc14475fe | ||
langcode: en | ||
status: true | ||
dependencies: | ||
enforced: | ||
module: | ||
- ys_starterkit | ||
id: ys_images_media | ||
class: null | ||
field_plugin_method: null | ||
cck_plugin_method: null | ||
migration_tags: null | ||
migration_group: ys_starterkit | ||
label: 'Starterkit Media' | ||
source: | ||
plugin: url | ||
data_fetcher_plugin: file | ||
data_parser_plugin: json | ||
urls: | ||
- profiles/custom/yalesites_profile/modules/custom/ys_starterkit/content/images.json | ||
item_selector: /data/images | ||
fields: | ||
- | ||
name: image_id | ||
label: 'Image ID' | ||
selector: image_id | ||
- | ||
name: image_url | ||
label: 'Image URL' | ||
selector: image_url | ||
- | ||
name: alt_text | ||
label: 'Alternate text' | ||
selector: alt_text | ||
ids: | ||
image_id: | ||
type: integer | ||
process: | ||
pseudo_destination_filename: | ||
- | ||
plugin: callback | ||
callable: basename | ||
source: image_url | ||
- | ||
plugin: skip_on_empty | ||
method: row | ||
message: 'Cannot import empty filename.' | ||
name: '@pseudo_destination_filename' | ||
field_media_image/target_id: | ||
plugin: migration_lookup | ||
migration: ys_images_files | ||
source: image_id | ||
thumbnail/target_id: | ||
plugin: migration_lookup | ||
migration: ys_images_files | ||
source: image_id | ||
field_media_image/alt: alt_text | ||
uid: | ||
plugin: default_value | ||
default_value: 1 | ||
destination: | ||
plugin: 'entity:media' | ||
default_bundle: image | ||
migration_dependencies: | ||
required: | ||
- ys_images_files |
93 changes: 93 additions & 0 deletions
93
...ustom/yalesites_profile/config/starterkit_config/migrate_plus.migration.ys_menu_links.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
uuid: 63dbb578-58f4-4dd9-b0a1-9edd3dbaa79f | ||
langcode: en | ||
status: true | ||
dependencies: | ||
enforced: | ||
module: | ||
- ys_starterkit | ||
id: ys_menu_links | ||
class: null | ||
field_plugin_method: null | ||
cck_plugin_method: null | ||
migration_tags: null | ||
migration_group: ys_starterkit | ||
label: 'Starterkit Menu Links' | ||
source: | ||
plugin: url | ||
data_fetcher_plugin: file | ||
data_parser_plugin: json | ||
urls: | ||
- profiles/custom/yalesites_profile/modules/custom/ys_starterkit/content/menu_links.json | ||
item_selector: data | ||
fields: | ||
- | ||
name: src_unique_id | ||
label: 'Unique ID' | ||
selector: unique_id | ||
- | ||
name: page_migration_id | ||
label: 'Reference to migrated page' | ||
selector: page_migration_id | ||
- | ||
name: name | ||
label: Name | ||
selector: name | ||
- | ||
name: parent_ref | ||
label: 'Parent menu link reference' | ||
selector: parent_ref | ||
constants: | ||
path: 'entity:node/' | ||
ids: | ||
src_unique_id: | ||
type: string | ||
process: | ||
menu_name: | ||
plugin: default_value | ||
default_value: main | ||
nid: | ||
- | ||
plugin: skip_on_empty | ||
method: process | ||
source: page_migration_id | ||
- | ||
plugin: migration_lookup | ||
migration: ys_pages | ||
parent_link_id: | ||
- | ||
plugin: migration_lookup | ||
migration: ys_menu_links | ||
source: parent_ref | ||
- | ||
plugin: default_value | ||
default_value: 0 | ||
title: | ||
plugin: get | ||
source: name | ||
language: en | ||
link/uri: | ||
plugin: concat | ||
source: | ||
- constants/path | ||
- '@nid' | ||
parent: | ||
plugin: menu_link_parent | ||
source: | ||
- parent_link_id | ||
- main | ||
external: | ||
plugin: default_value | ||
default_value: 0 | ||
expanded: | ||
plugin: default_value | ||
default_value: 0 | ||
enabled: | ||
plugin: default_value | ||
default_value: 1 | ||
destination: | ||
plugin: 'entity:menu_link_content' | ||
bundle: menu_link_content | ||
no_stub: true | ||
migration_dependencies: | ||
required: | ||
- ys_pages |
47 changes: 47 additions & 0 deletions
47
...les/custom/yalesites_profile/config/starterkit_config/migrate_plus.migration.ys_pages.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
uuid: 52099feb-f57f-4f06-a7b4-57f2fe441095 | ||
langcode: en | ||
status: true | ||
dependencies: | ||
enforced: | ||
module: | ||
- ys_starterkit | ||
id: ys_pages | ||
class: null | ||
field_plugin_method: null | ||
cck_plugin_method: null | ||
migration_tags: null | ||
migration_group: ys_starterkit | ||
label: 'Starterkit Pages' | ||
source: | ||
plugin: url | ||
data_fetcher_plugin: file | ||
data_parser_plugin: json | ||
urls: | ||
- profiles/custom/yalesites_profile/modules/custom/ys_starterkit/content/pages.json | ||
item_selector: /data/pages | ||
fields: | ||
- | ||
name: src_unique_id | ||
label: 'Unique ID' | ||
selector: unique_id | ||
- | ||
name: src_title | ||
label: Title | ||
selector: title | ||
ids: | ||
src_unique_id: | ||
type: string | ||
process: | ||
uid: | ||
plugin: default_value | ||
default_value: 1 | ||
status: | ||
plugin: default_value | ||
default_value: true | ||
title: src_title | ||
destination: | ||
plugin: 'entity:node' | ||
default_bundle: page | ||
migration_dependencies: | ||
required: | ||
- ys_images_media |
60 changes: 60 additions & 0 deletions
60
...les/custom/yalesites_profile/config/starterkit_config/migrate_plus.migration.ys_posts.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
uuid: 04681e16-4ad0-4003-ad86-faff4e99879e | ||
langcode: en | ||
status: true | ||
dependencies: | ||
enforced: | ||
module: | ||
- ys_starterkit | ||
id: ys_posts | ||
class: null | ||
field_plugin_method: null | ||
cck_plugin_method: null | ||
migration_tags: null | ||
migration_group: ys_starterkit | ||
label: 'Starterkit Post' | ||
source: | ||
plugin: url | ||
data_fetcher_plugin: file | ||
data_parser_plugin: json | ||
urls: | ||
- profiles/custom/yalesites_profile/modules/custom/ys_starterkit/content/posts.json | ||
item_selector: /data/posts | ||
fields: | ||
- | ||
name: src_unique_id | ||
label: 'Unique ID' | ||
selector: unique_id | ||
- | ||
name: src_title | ||
label: Title | ||
selector: title | ||
- | ||
name: src_author | ||
label: Author | ||
selector: field_author | ||
ids: | ||
src_unique_id: | ||
type: string | ||
constants: | ||
date_format: Y-m-d | ||
process: | ||
uid: | ||
plugin: default_value | ||
default_value: 1 | ||
status: | ||
plugin: default_value | ||
default_value: true | ||
title: src_title | ||
field_author: src_author | ||
field_publish_date: | ||
plugin: callback | ||
callable: date | ||
unpack_source: true | ||
source: | ||
- constants/date_format | ||
destination: | ||
plugin: 'entity:node' | ||
default_bundle: post | ||
migration_dependencies: | ||
required: | ||
- ys_images_media |
Oops, something went wrong.