Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YALB-1550: Single Content Sync #409

Merged
merged 2 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion web/profiles/custom/yalesites_profile/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"drupal/section_library": "^1.1",
"drupal/selective_better_exposed_filters": "^3.0@beta",
"drupal/simple_sitemap": "^4.1",
"drupal/single_content_sync": "^1.4",
"drupal/smart_date": "^3.5",
"drupal/twig_tweak": "^3.1",
"drupal/typogrify": "^1.2",
Expand Down Expand Up @@ -112,7 +113,8 @@
"drupal/core": {
"plural results summary https://www.drupal.org/project/drupal/issues/2888320": "https://www.drupal.org/files/issues/2021-12-15/2888320-78.patch",
"Prevent media library item overflow https://www.drupal.org/project/drupal/issues/3059955": "https://www.drupal.org/files/issues/2023-03-18/3059955-167.patch",
"Remove for Drupal 10 - CKEditor 5 should not grow to infinite height https://www.drupal.org/project/drupal/issues/3273755": "https://www.drupal.org/files/issues/2023-07-26/ckeditor-height-fix.patch"
"Remove for Drupal 10 - CKEditor 5 should not grow to infinite height https://www.drupal.org/project/drupal/issues/3273755": "https://www.drupal.org/files/issues/2023-07-26/ckeditor-height-fix.patch",
"Fix ZipArchive deprecation: https://www.drupal.org/project/single_content_sync/issues/3364535": "https://www.drupal.org/files/issues/2022-08-22/2850794-51.patch"
},
"drupal/entity_redirect": {
"fix layout route https://www.drupal.org/project/entity_redirect/issues/3352265": "https://git.drupalcode.org/project/entity_redirect/-/merge_requests/6.patch"
Expand Down
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>
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: { }
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
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
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
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
Loading