clean install

This commit is contained in:
matze committed 2024-12-10 15:08:16 +01:00
commit e14eb2d8fd
31193 files changed
+3555714

No files matched your search

@@ -0,0 +1 @@
interval: 10800
@@ -0,0 +1,7 @@
langcode: en
status: true
dependencies: { }
id: basic
label: 'Basic block'
revision: false
description: 'A basic block contains a title and a body.'
@@ -0,0 +1,7 @@
langcode: en
status: true
dependencies: { }
id: comment
label: 'Default comments'
target_entity_type_id: node
description: 'Allows commenting on content'
@@ -0,0 +1,11 @@
langcode: en
status: true
dependencies: { }
id: feedback
label: 'Website feedback'
recipients:
- [email protected]
reply: ''
weight: 0
message: 'Your message has been sent.'
redirect: ''
@@ -0,0 +1,21 @@
langcode: en
status: true
dependencies:
config:
- node.type.page
id: node.page.promote
field_name: promote
entity_type: node
bundle: page
label: 'Promoted to front page'
description: ''
required: false
translatable: false
default_value:
-
value: 0
default_value_callback: ''
settings:
on_label: 'On'
off_label: 'Off'
field_type: boolean
@@ -0,0 +1,32 @@
langcode: en
status: true
dependencies:
config:
- block_content.type.basic
- field.field.block_content.basic.body
module:
- text
id: block_content.basic.default
targetEntityType: block_content
bundle: basic
mode: default
content:
body:
type: text_textarea_with_summary
weight: -4
region: content
settings:
rows: 9
summary_rows: 3
placeholder: ''
show_summary: false
third_party_settings: { }
info:
type: string_textfield
weight: -5
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
hidden: { }
@@ -0,0 +1,33 @@
langcode: en
status: true
dependencies:
config:
- comment.type.comment
- field.field.comment.comment.comment_body
module:
- text
id: comment.comment.default
targetEntityType: comment
bundle: comment
mode: default
content:
author:
weight: -2
region: content
comment_body:
type: text_textarea
weight: 11
region: content
settings:
rows: 5
placeholder: ''
third_party_settings: { }
subject:
type: string_textfield
weight: 10
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
hidden: { }
@@ -0,0 +1,106 @@
langcode: en
status: true
dependencies:
config:
- field.field.node.article.body
- field.field.node.article.comment
- field.field.node.article.field_image
- field.field.node.article.field_tags
- image.style.thumbnail
- node.type.article
module:
- comment
- image
- path
- text
id: node.article.default
targetEntityType: node
bundle: article
mode: default
content:
body:
type: text_textarea_with_summary
weight: 2
region: content
settings:
rows: 9
summary_rows: 3
placeholder: ''
show_summary: false
third_party_settings: { }
comment:
type: comment_default
weight: 20
region: content
settings: { }
third_party_settings: { }
created:
type: datetime_timestamp
weight: 10
region: content
settings: { }
third_party_settings: { }
field_image:
type: image_image
weight: 1
region: content
settings:
progress_indicator: throbber
preview_image_style: thumbnail
third_party_settings: { }
field_tags:
type: entity_reference_autocomplete_tags
weight: 3
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
path:
type: path
weight: 30
region: content
settings: { }
third_party_settings: { }
promote:
type: boolean_checkbox
weight: 15
region: content
settings:
display_label: true
third_party_settings: { }
status:
type: boolean_checkbox
weight: 120
region: content
settings:
display_label: true
third_party_settings: { }
sticky:
type: boolean_checkbox
weight: 16
region: content
settings:
display_label: true
third_party_settings: { }
title:
type: string_textfield
weight: 0
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 5
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
hidden: { }
@@ -0,0 +1,76 @@
langcode: en
status: true
dependencies:
config:
- field.field.node.page.body
- node.type.page
module:
- path
- text
id: node.page.default
targetEntityType: node
bundle: page
mode: default
content:
body:
type: text_textarea_with_summary
weight: 31
region: content
settings:
rows: 9
summary_rows: 3
placeholder: ''
show_summary: false
third_party_settings: { }
created:
type: datetime_timestamp
weight: 10
region: content
settings: { }
third_party_settings: { }
path:
type: path
weight: 30
region: content
settings: { }
third_party_settings: { }
promote:
type: boolean_checkbox
weight: 15
region: content
settings:
display_label: true
third_party_settings: { }
status:
type: boolean_checkbox
weight: 120
region: content
settings:
display_label: true
third_party_settings: { }
sticky:
type: boolean_checkbox
weight: 16
region: content
settings:
display_label: true
third_party_settings: { }
title:
type: string_textfield
weight: -5
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 5
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
hidden: { }
@@ -0,0 +1,35 @@
langcode: en
status: true
dependencies:
config:
- field.field.user.user.user_picture
- image.style.thumbnail
module:
- image
- user
id: user.user.default
targetEntityType: user
bundle: user
mode: default
content:
account:
weight: -10
region: content
contact:
weight: 5
region: content
language:
weight: 0
region: content
timezone:
weight: 6
region: content
user_picture:
type: image_image
weight: -1
region: content
settings:
progress_indicator: throbber
preview_image_style: thumbnail
third_party_settings: { }
hidden: { }
@@ -0,0 +1,21 @@
langcode: en
status: true
dependencies:
config:
- block_content.type.basic
- field.field.block_content.basic.body
module:
- text
id: block_content.basic.default
targetEntityType: block_content
bundle: basic
mode: default
content:
body:
type: text_default
label: hidden
settings: { }
third_party_settings: { }
weight: 0
region: content
hidden: { }
@@ -0,0 +1,24 @@
langcode: en
status: true
dependencies:
config:
- comment.type.comment
- field.field.comment.comment.comment_body
module:
- text
id: comment.comment.default
targetEntityType: comment
bundle: comment
mode: default
content:
comment_body:
type: text_default
label: hidden
settings: { }
third_party_settings: { }
weight: 0
region: content
links:
weight: 100
region: content
hidden: { }
@@ -0,0 +1,62 @@
langcode: en
status: true
dependencies:
config:
- core.entity_view_display.comment.comment.default
- field.field.node.article.body
- field.field.node.article.comment
- field.field.node.article.field_image
- field.field.node.article.field_tags
- image.style.wide
- node.type.article
module:
- comment
- image
- text
- user
id: node.article.default
targetEntityType: node
bundle: article
mode: default
content:
body:
type: text_default
label: hidden
settings: { }
third_party_settings: { }
weight: 0
region: content
comment:
type: comment_default
label: above
settings:
view_mode: default
pager_id: 0
third_party_settings: { }
weight: 110
region: content
field_image:
type: image
label: hidden
settings:
image_link: ''
image_style: wide
image_loading:
attribute: eager
third_party_settings: { }
weight: -1
region: content
field_tags:
type: entity_reference_label
label: above
settings:
link: true
third_party_settings: { }
weight: 10
region: content
links:
settings: { }
third_party_settings: { }
weight: 100
region: content
hidden: { }
@@ -0,0 +1,25 @@
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.node.rss
- field.field.node.article.body
- field.field.node.article.comment
- field.field.node.article.field_image
- field.field.node.article.field_tags
- node.type.article
module:
- user
id: node.article.rss
targetEntityType: node
bundle: article
mode: rss
content:
links:
weight: 100
region: content
hidden:
body: true
comment: true
field_image: true
field_tags: true
@@ -0,0 +1,52 @@
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.node.teaser
- field.field.node.article.body
- field.field.node.article.comment
- field.field.node.article.field_image
- field.field.node.article.field_tags
- image.style.medium
- node.type.article
module:
- image
- text
- user
id: node.article.teaser
targetEntityType: node
bundle: article
mode: teaser
content:
body:
type: text_summary_or_trimmed
label: hidden
settings:
trim_length: 600
third_party_settings: { }
weight: 0
region: content
field_image:
type: image
label: hidden
settings:
image_link: content
image_style: medium
image_loading:
attribute: lazy
third_party_settings: { }
weight: -1
region: content
field_tags:
type: entity_reference_label
label: above
settings:
link: true
third_party_settings: { }
weight: 10
region: content
links:
weight: 100
region: content
hidden:
comment: true
@@ -0,0 +1,25 @@
langcode: en
status: true
dependencies:
config:
- field.field.node.page.body
- node.type.page
module:
- text
- user
id: node.page.default
targetEntityType: node
bundle: page
mode: default
content:
body:
type: text_default
label: hidden
settings: { }
third_party_settings: { }
weight: 100
region: content
links:
weight: 101
region: content
hidden: { }
@@ -0,0 +1,27 @@
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.node.teaser
- field.field.node.page.body
- node.type.page
module:
- text
- user
id: node.page.teaser
targetEntityType: node
bundle: page
mode: teaser
content:
body:
type: text_summary_or_trimmed
label: hidden
settings:
trim_length: 600
third_party_settings: { }
weight: 100
region: content
links:
weight: 101
region: content
hidden: { }
@@ -0,0 +1,28 @@
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.user.compact
- field.field.user.user.user_picture
- image.style.thumbnail
module:
- image
- user
id: user.user.compact
targetEntityType: user
bundle: user
mode: compact
content:
user_picture:
type: image
label: hidden
settings:
image_style: thumbnail
image_link: content
image_loading:
attribute: lazy
third_party_settings: { }
weight: 0
region: content
hidden:
member_for: true
@@ -0,0 +1,29 @@
langcode: en
status: true
dependencies:
config:
- field.field.user.user.user_picture
- image.style.thumbnail
module:
- image
- user
id: user.user.default
targetEntityType: user
bundle: user
mode: default
content:
member_for:
weight: 5
region: content
user_picture:
type: image
label: hidden
settings:
image_style: thumbnail
image_link: content
image_loading:
attribute: lazy
third_party_settings: { }
weight: 0
region: content
hidden: { }
@@ -0,0 +1,7 @@
definitions:
contact__site_page:
menu_name: footer
parent: ''
weight: 0
expanded: false
enabled: true
@@ -0,0 +1,65 @@
langcode: en
status: true
dependencies:
config:
- filter.format.basic_html
module:
- ckeditor5
format: basic_html
editor: ckeditor5
settings:
toolbar:
items:
- bold
- italic
- '|'
- link
- '|'
- bulletedList
- numberedList
- '|'
- blockQuote
- drupalInsertImage
- '|'
- heading
- code
- '|'
- sourceEditing
plugins:
ckeditor5_heading:
enabled_headings:
- heading2
- heading3
- heading4
- heading5
- heading6
ckeditor5_imageResize:
allow_resize: true
ckeditor5_list:
properties:
reversed: false
startIndex: true
multiBlock: true
ckeditor5_sourceEditing:
allowed_tags:
- '<cite>'
- '<dl>'
- '<dt>'
- '<dd>'
- '<a hreflang>'
- '<blockquote cite>'
- '<ul type>'
- '<ol type>'
- '<h2 id>'
- '<h3 id>'
- '<h4 id>'
- '<h5 id>'
- '<h6 id>'
image_upload:
status: true
scheme: public
directory: inline-images
max_size: null
max_dimensions:
width: null
height: null
@@ -0,0 +1,102 @@
langcode: en
status: true
dependencies:
config:
- filter.format.full_html
module:
- ckeditor5
format: full_html
editor: ckeditor5
settings:
toolbar:
items:
- bold
- italic
- strikethrough
- superscript
- subscript
- removeFormat
- '|'
- link
- '|'
- bulletedList
- numberedList
- '|'
- blockQuote
- drupalInsertImage
- insertTable
- horizontalLine
- '|'
- heading
- codeBlock
- '|'
- sourceEditing
plugins:
ckeditor5_codeBlock:
languages:
-
label: 'Plain text'
language: plaintext
-
label: C
language: c
-
label: 'C#'
language: cs
-
label: C++
language: cpp
-
label: CSS
language: css
-
label: Diff
language: diff
-
label: HTML
language: html
-
label: Java
language: java
-
label: JavaScript
language: javascript
-
label: PHP
language: php
-
label: Python
language: python
-
label: Ruby
language: ruby
-
label: TypeScript
language: typescript
-
label: XML
language: xml
ckeditor5_heading:
enabled_headings:
- heading2
- heading3
- heading4
- heading5
- heading6
ckeditor5_imageResize:
allow_resize: true
ckeditor5_list:
properties:
reversed: true
startIndex: true
multiBlock: true
ckeditor5_sourceEditing:
allowed_tags: { }
image_upload:
status: true
scheme: public
directory: inline-images
max_size: null
max_dimensions:
width: null
height: null
@@ -0,0 +1,23 @@
langcode: en
status: true
dependencies:
config:
- block_content.type.basic
- field.storage.block_content.body
module:
- text
id: block_content.basic.body
field_name: body
entity_type: block_content
bundle: basic
label: Body
description: ''
required: false
translatable: true
default_value: { }
default_value_callback: ''
settings:
display_summary: false
required_summary: false
allowed_formats: { }
field_type: text_with_summary
@@ -0,0 +1,21 @@
langcode: en
status: true
dependencies:
config:
- comment.type.comment
- field.storage.comment.comment_body
module:
- text
id: comment.comment.comment_body
field_name: comment_body
entity_type: comment
bundle: comment
label: Comment
description: ''
required: true
translatable: true
default_value: { }
default_value_callback: ''
settings:
allowed_formats: { }
field_type: text_long
@@ -0,0 +1,23 @@
langcode: en
status: true
dependencies:
config:
- field.storage.node.body
- node.type.article
module:
- text
id: node.article.body
field_name: body
entity_type: node
bundle: article
label: Body
description: ''
required: false
translatable: true
default_value: { }
default_value_callback: ''
settings:
display_summary: true
required_summary: false
allowed_formats: { }
field_type: text_with_summary
@@ -0,0 +1,32 @@
langcode: en
status: true
dependencies:
config:
- field.storage.node.comment
- node.type.article
module:
- comment
id: node.article.comment
field_name: comment
entity_type: node
bundle: article
label: Comments
description: ''
required: false
translatable: true
default_value:
-
status: 2
cid: 0
last_comment_timestamp: 0
last_comment_name: null
last_comment_uid: 0
comment_count: 0
default_value_callback: ''
settings:
default_mode: 1
per_page: 50
anonymous: 0
form_location: true
preview: 1
field_type: comment
@@ -0,0 +1,37 @@
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_image
- node.type.article
module:
- image
id: node.article.field_image
field_name: field_image
entity_type: node
bundle: article
label: Image
description: ''
required: false
translatable: true
default_value: { }
default_value_callback: ''
settings:
handler: 'default:file'
handler_settings: { }
file_directory: '[date:custom:Y]-[date:custom:m]'
file_extensions: 'png gif jpg jpeg webp'
max_filesize: ''
max_resolution: ''
min_resolution: ''
alt_field: true
alt_field_required: true
title_field: false
title_field_required: false
default_image:
uuid: null
alt: ''
title: ''
width: null
height: null
field_type: image
@@ -0,0 +1,26 @@
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_tags
- node.type.article
- taxonomy.vocabulary.tags
id: node.article.field_tags
field_name: field_tags
entity_type: node
bundle: article
label: Tags
description: 'Enter a comma-separated list. For example: Amsterdam, Mexico City, "Cleveland, Ohio"'
required: false
translatable: true
default_value: { }
default_value_callback: ''
settings:
handler: 'default:taxonomy_term'
handler_settings:
target_bundles:
tags: tags
sort:
field: _none
auto_create: true
field_type: entity_reference
@@ -0,0 +1,23 @@
langcode: en
status: true
dependencies:
config:
- field.storage.node.body
- node.type.page
module:
- text
id: node.page.body
field_name: body
entity_type: node
bundle: page
label: Body
description: ''
required: false
translatable: true
default_value: { }
default_value_callback: ''
settings:
display_summary: true
required_summary: false
allowed_formats: { }
field_type: text_with_summary
@@ -0,0 +1,37 @@
langcode: en
status: true
dependencies:
config:
- field.storage.user.user_picture
module:
- image
- user
id: user.user.user_picture
field_name: user_picture
entity_type: user
bundle: user
label: Picture
description: 'Your virtual face or picture.'
required: false
translatable: true
default_value: { }
default_value_callback: ''
settings:
handler: 'default:file'
handler_settings: { }
file_directory: 'pictures/[date:custom:Y]-[date:custom:m]'
file_extensions: 'png gif jpg jpeg webp'
max_filesize: ''
max_resolution: ''
min_resolution: ''
alt_field: false
alt_field_required: false
title_field: false
title_field_required: false
default_image:
uuid: null
alt: ''
title: ''
width: null
height: null
field_type: image
@@ -0,0 +1,19 @@
langcode: en
status: true
dependencies:
module:
- comment
- node
id: node.comment
field_name: comment
entity_type: node
type: comment
settings:
comment_type: comment
module: comment
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
@@ -0,0 +1,31 @@
langcode: en
status: true
dependencies:
module:
- file
- image
- node
id: node.field_image
field_name: field_image
entity_type: node
type: image
settings:
target_type: file
display_field: false
display_default: false
uri_scheme: public
default_image:
uuid: null
alt: ''
title: ''
width: null
height: null
module: image
locked: false
cardinality: 1
translatable: true
indexes:
target_id:
- target_id
persist_with_no_fields: false
custom_storage: false
@@ -0,0 +1,19 @@
langcode: en
status: true
dependencies:
module:
- node
- taxonomy
id: node.field_tags
field_name: field_tags
entity_type: node
type: entity_reference
settings:
target_type: taxonomy_term
module: core
locked: false
cardinality: -1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
@@ -0,0 +1,31 @@
langcode: en
status: true
dependencies:
module:
- file
- image
- user
id: user.user_picture
field_name: user_picture
entity_type: user
type: image
settings:
target_type: file
display_field: false
display_default: false
uri_scheme: public
default_image:
uuid: null
alt: ''
title: ''
width: null
height: null
module: image
locked: false
cardinality: 1
translatable: true
indexes:
target_id:
- target_id
persist_with_no_fields: false
custom_storage: false
@@ -0,0 +1,50 @@
langcode: en
status: true
dependencies:
module:
- editor
name: 'Basic HTML'
format: basic_html
weight: 0
roles:
- authenticated
filters:
editor_file_reference:
id: editor_file_reference
provider: editor
status: true
weight: 11
settings: { }
filter_align:
id: filter_align
provider: filter
status: true
weight: 7
settings: { }
filter_caption:
id: filter_caption
provider: filter
status: true
weight: 8
settings: { }
filter_html:
id: filter_html
provider: filter
status: true
weight: -10
settings:
allowed_html: '<br> <p> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <cite> <dl> <dt> <dd> <a hreflang href> <blockquote cite> <ul type> <ol start type> <strong> <em> <code> <li> <img src alt data-entity-uuid data-entity-type height width data-caption data-align>'
filter_html_help: false
filter_html_nofollow: false
filter_html_image_secure:
id: filter_html_image_secure
provider: filter
status: true
weight: 9
settings: { }
filter_image_lazy_load:
id: filter_image_lazy_load
provider: filter
status: true
weight: 15
settings: { }
@@ -0,0 +1,41 @@
langcode: en
status: true
dependencies:
module:
- editor
name: 'Full HTML'
format: full_html
weight: 2
roles:
- administrator
filters:
editor_file_reference:
id: editor_file_reference
provider: editor
status: true
weight: 11
settings: { }
filter_align:
id: filter_align
provider: filter
status: true
weight: 8
settings: { }
filter_caption:
id: filter_caption
provider: filter
status: true
weight: 9
settings: { }
filter_htmlcorrector:
id: filter_htmlcorrector
provider: filter
status: true
weight: 10
settings: { }
filter_image_lazy_load:
id: filter_image_lazy_load
provider: filter
status: true
weight: 15
settings: { }
@@ -0,0 +1,31 @@
langcode: en
status: true
dependencies: { }
name: 'Restricted HTML'
format: restricted_html
weight: 1
roles:
- anonymous
filters:
filter_autop:
id: filter_autop
provider: filter
status: true
weight: 0
settings: { }
filter_html:
id: filter_html
provider: filter
status: true
weight: -10
settings:
allowed_html: '<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>'
filter_html_help: true
filter_html_nofollow: false
filter_url:
id: filter_url
provider: filter
status: true
weight: 0
settings:
filter_url_length: 72
@@ -0,0 +1 @@
use_admin_theme: true
@@ -0,0 +1,10 @@
langcode: en
status: true
dependencies: { }
name: Article
type: article
description: 'Use <em>articles</em> for time-sensitive content like news, press releases or blog posts.'
help: null
new_revision: true
preview_mode: 1
display_submitted: true
@@ -0,0 +1,10 @@
langcode: en
status: true
dependencies: { }
name: 'Basic page'
type: page
description: 'Use <em>basic pages</em> for your static content, such as an ''About us'' page.'
help: null
new_revision: true
preview_mode: 1
display_submitted: false
@@ -0,0 +1,4 @@
threshold:
requirements_warning: 172800
requirements_error: 1209600
logging: true
@@ -0,0 +1,13 @@
langcode: en
uuid: ''
name: ''
mail: ''
slogan: ''
page:
403: ''
404: ''
front: /node
admin_compact_mode: false
weight_select_max: 100
default_langcode: en
mail_notification: null
@@ -0,0 +1,2 @@
admin: claro
default: olivero
@@ -0,0 +1,8 @@
langcode: en
status: true
dependencies: { }
name: Tags
vid: tags
description: 'Use tags to group articles on similar topics into categories.'
weight: 0
new_revision: false
@@ -0,0 +1,8 @@
langcode: en
status: true
dependencies: { }
id: administrator
label: Administrator
weight: 3
is_admin: true
permissions: { }
@@ -0,0 +1,21 @@
langcode: en
status: true
dependencies:
config:
- filter.format.restricted_html
module:
- comment
- contact
- filter
- search
- system
id: anonymous
label: 'Anonymous user'
weight: 0
is_admin: false
permissions:
- 'access comments'
- 'access content'
- 'access site-wide contact form'
- 'search content'
- 'use text format restricted_html'
@@ -0,0 +1,27 @@
langcode: en
status: true
dependencies:
config:
- filter.format.basic_html
module:
- comment
- contact
- file
- filter
- search
- shortcut
- system
id: authenticated
label: 'Authenticated user'
weight: 1
is_admin: false
permissions:
- 'access comments'
- 'access content'
- 'access shortcuts'
- 'access site-wide contact form'
- 'delete own files'
- 'post comments'
- 'search content'
- 'skip comment approval'
- 'use text format basic_html'
@@ -0,0 +1,44 @@
langcode: en
status: true
dependencies:
config:
- node.type.article
- node.type.page
- taxonomy.vocabulary.tags
module:
- comment
- contextual
- file
- node
- path
- system
- taxonomy
- toolbar
id: content_editor
label: 'Content editor'
weight: 2
is_admin: false
permissions:
- 'access administration pages'
- 'access content overview'
- 'access contextual links'
- 'access files overview'
- 'access toolbar'
- 'administer url aliases'
- 'create article content'
- 'create page content'
- 'create terms in tags'
- 'create url aliases'
- 'delete article revisions'
- 'delete own article content'
- 'delete own files'
- 'delete own page content'
- 'delete page revisions'
- 'edit own article content'
- 'edit own comments'
- 'edit own page content'
- 'edit terms in tags'
- 'revert all revisions'
- 'view all revisions'
- 'view own unpublished content'
- 'view the administration theme'
@@ -0,0 +1,16 @@
langcode: en
anonymous: Anonymous
verify_mail: true
notify:
cancel_confirm: true
password_reset: true
status_activated: true
status_blocked: false
status_canceled: false
register_admin_created: true
register_no_approval_required: true
register_pending_approval: true
register: visitors_admin_approval
cancel_method: user_cancel_block
password_reset_timeout: 86400
password_strength: true
@@ -0,0 +1,52 @@
langcode: en
status: true
dependencies:
config:
- field.field.media.audio.field_media_audio_file
- media.type.audio
module:
- file
- path
id: media.audio.default
targetEntityType: media
bundle: audio
mode: default
content:
created:
type: datetime_timestamp
weight: 10
region: content
settings: { }
third_party_settings: { }
field_media_audio_file:
type: file_generic
weight: 0
region: content
settings:
progress_indicator: throbber
third_party_settings: { }
path:
type: path
weight: 30
region: content
settings: { }
third_party_settings: { }
status:
type: boolean_checkbox
weight: 100
region: content
settings:
display_label: true
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 5
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
hidden:
name: true
@@ -0,0 +1,19 @@
langcode: en
status: true
dependencies:
config:
- core.entity_form_mode.media.media_library
- field.field.media.audio.field_media_audio_file
- media.type.audio
id: media.audio.media_library
targetEntityType: media
bundle: audio
mode: media_library
content: { }
hidden:
created: true
field_media_audio_file: true
name: true
path: true
status: true
uid: true
@@ -0,0 +1,45 @@
langcode: en
status: true
dependencies:
config:
- field.field.media.document.field_media_document
- media.type.document
module:
- file
id: media.document.default
targetEntityType: media
bundle: document
mode: default
content:
created:
type: datetime_timestamp
weight: 10
region: content
settings: { }
third_party_settings: { }
field_media_document:
type: file_generic
weight: 0
region: content
settings:
progress_indicator: throbber
third_party_settings: { }
status:
type: boolean_checkbox
weight: 100
region: content
settings:
display_label: true
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 5
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
hidden:
name: true
@@ -0,0 +1,19 @@
langcode: en
status: true
dependencies:
config:
- core.entity_form_mode.media.media_library
- field.field.media.document.field_media_document
- media.type.document
id: media.document.media_library
targetEntityType: media
bundle: document
mode: media_library
content: { }
hidden:
created: true
field_media_document: true
name: true
path: true
status: true
uid: true
@@ -0,0 +1,47 @@
langcode: en
status: true
dependencies:
config:
- field.field.media.image.field_media_image
- image.style.thumbnail
- media.type.image
module:
- image
id: media.image.default
targetEntityType: media
bundle: image
mode: default
content:
created:
type: datetime_timestamp
weight: 10
region: content
settings: { }
third_party_settings: { }
field_media_image:
type: image_image
weight: 0
region: content
settings:
progress_indicator: throbber
preview_image_style: thumbnail
third_party_settings: { }
status:
type: boolean_checkbox
weight: 100
region: content
settings:
display_label: true
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 5
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
hidden:
name: true
@@ -0,0 +1,29 @@
langcode: en
status: true
dependencies:
config:
- core.entity_form_mode.media.media_library
- field.field.media.image.field_media_image
- image.style.thumbnail
- media.type.image
module:
- image
id: media.image.media_library
targetEntityType: media
bundle: image
mode: media_library
content:
field_media_image:
type: image_image
weight: 1
region: content
settings:
progress_indicator: throbber
preview_image_style: thumbnail
third_party_settings: { }
hidden:
created: true
name: true
path: true
status: true
uid: true
@@ -0,0 +1,53 @@
langcode: en
status: true
dependencies:
config:
- field.field.media.remote_video.field_media_oembed_video
- media.type.remote_video
module:
- media
- path
id: media.remote_video.default
targetEntityType: media
bundle: remote_video
mode: default
content:
created:
type: datetime_timestamp
weight: 10
region: content
settings: { }
third_party_settings: { }
field_media_oembed_video:
type: oembed_textfield
weight: 0
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
path:
type: path
weight: 30
region: content
settings: { }
third_party_settings: { }
status:
type: boolean_checkbox
weight: 100
region: content
settings:
display_label: true
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 5
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
hidden:
name: true
@@ -0,0 +1,19 @@
langcode: en
status: true
dependencies:
config:
- core.entity_form_mode.media.media_library
- field.field.media.remote_video.field_media_oembed_video
- media.type.remote_video
id: media.remote_video.media_library
targetEntityType: media
bundle: remote_video
mode: media_library
content: { }
hidden:
created: true
field_media_oembed_video: true
name: true
path: true
status: true
uid: true
@@ -0,0 +1,52 @@
langcode: en
status: true
dependencies:
config:
- field.field.media.video.field_media_video_file
- media.type.video
module:
- file
- path
id: media.video.default
targetEntityType: media
bundle: video
mode: default
content:
created:
type: datetime_timestamp
weight: 10
region: content
settings: { }
third_party_settings: { }
field_media_video_file:
type: file_generic
weight: 0
region: content
settings:
progress_indicator: throbber
third_party_settings: { }
path:
type: path
weight: 30
region: content
settings: { }
third_party_settings: { }
status:
type: boolean_checkbox
weight: 100
region: content
settings:
display_label: true
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 5
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
hidden:
name: true
@@ -0,0 +1,19 @@
langcode: en
status: true
dependencies:
config:
- core.entity_form_mode.media.media_library
- field.field.media.video.field_media_video_file
- media.type.video
id: media.video.media_library
targetEntityType: media
bundle: video
mode: media_library
content: { }
hidden:
created: true
field_media_video_file: true
name: true
path: true
status: true
uid: true
@@ -0,0 +1,29 @@
langcode: en
status: true
dependencies:
config:
- field.field.media.audio.field_media_audio_file
- media.type.audio
module:
- file
id: media.audio.default
targetEntityType: media
bundle: audio
mode: default
content:
field_media_audio_file:
type: file_audio
label: visually_hidden
settings:
controls: true
autoplay: false
loop: false
multiple_file_display_type: tags
third_party_settings: { }
weight: 0
region: content
hidden:
created: true
name: true
thumbnail: true
uid: true
@@ -0,0 +1,31 @@
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.media.media_library
- field.field.media.audio.field_media_audio_file
- image.style.thumbnail
- media.type.audio
module:
- image
id: media.audio.media_library
targetEntityType: media
bundle: audio
mode: media_library
content:
thumbnail:
type: image
label: hidden
settings:
image_style: thumbnail
image_link: ''
image_loading:
attribute: lazy
third_party_settings: { }
weight: 0
region: content
hidden:
created: true
field_media_audio_file: true
name: true
uid: true
@@ -0,0 +1,25 @@
langcode: en
status: true
dependencies:
config:
- field.field.media.document.field_media_document
- media.type.document
module:
- file
id: media.document.default
targetEntityType: media
bundle: document
mode: default
content:
field_media_document:
type: file_default
label: visually_hidden
settings: { }
third_party_settings: { }
weight: 1
region: content
hidden:
created: true
thumbnail: true
uid: true
name: true
@@ -0,0 +1,31 @@
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.media.media_library
- field.field.media.document.field_media_document
- image.style.thumbnail
- media.type.document
module:
- image
id: media.document.media_library
targetEntityType: media
bundle: document
mode: media_library
content:
thumbnail:
type: image
label: hidden
settings:
image_style: thumbnail
image_link: ''
image_loading:
attribute: lazy
third_party_settings: { }
weight: 0
region: content
hidden:
created: true
field_media_document: true
name: true
uid: true
@@ -0,0 +1,30 @@
langcode: en
status: true
dependencies:
config:
- field.field.media.image.field_media_image
- image.style.large
- media.type.image
module:
- image
id: media.image.default
targetEntityType: media
bundle: image
mode: default
content:
field_media_image:
type: image
label: visually_hidden
settings:
image_style: 'large'
image_link: ''
image_loading:
attribute: lazy
third_party_settings: { }
weight: 1
region: content
hidden:
created: true
thumbnail: true
uid: true
name: true
@@ -0,0 +1,31 @@
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.media.media_library
- field.field.media.image.field_media_image
- image.style.medium
- media.type.image
module:
- image
id: media.image.media_library
targetEntityType: media
bundle: image
mode: media_library
content:
thumbnail:
type: image
label: hidden
settings:
image_style: medium
image_link: ''
image_loading:
attribute: lazy
third_party_settings: { }
weight: 0
region: content
hidden:
created: true
field_media_image: true
name: true
uid: true
@@ -0,0 +1,29 @@
langcode: en
status: true
dependencies:
config:
- field.field.media.remote_video.field_media_oembed_video
- media.type.remote_video
module:
- media
id: media.remote_video.default
targetEntityType: media
bundle: remote_video
mode: default
content:
field_media_oembed_video:
type: oembed
label: hidden
settings:
max_width: 0
max_height: 0
loading:
attribute: lazy
third_party_settings: { }
weight: 0
region: content
hidden:
created: true
name: true
thumbnail: true
uid: true
@@ -0,0 +1,31 @@
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.media.media_library
- field.field.media.remote_video.field_media_oembed_video
- image.style.medium
- media.type.remote_video
module:
- image
id: media.remote_video.media_library
targetEntityType: media
bundle: remote_video
mode: media_library
content:
thumbnail:
type: image
label: hidden
settings:
image_style: medium
image_link: ''
image_loading:
attribute: lazy
third_party_settings: { }
weight: 0
region: content
hidden:
created: true
field_media_oembed_video: true
name: true
uid: true
@@ -0,0 +1,32 @@
langcode: en
status: true
dependencies:
config:
- field.field.media.video.field_media_video_file
- media.type.video
module:
- file
id: media.video.default
targetEntityType: media
bundle: video
mode: default
content:
field_media_video_file:
type: file_video
label: visually_hidden
settings:
controls: true
autoplay: false
loop: false
multiple_file_display_type: tags
muted: false
width: 640
height: 480
third_party_settings: { }
weight: 0
region: content
hidden:
created: true
name: true
thumbnail: true
uid: true
@@ -0,0 +1,31 @@
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.media.media_library
- field.field.media.video.field_media_video_file
- image.style.thumbnail
- media.type.video
module:
- image
id: media.video.media_library
targetEntityType: media
bundle: video
mode: media_library
content:
thumbnail:
type: image
label: hidden
settings:
image_style: thumbnail
image_link: ''
image_loading:
attribute: lazy
third_party_settings: { }
weight: 0
region: content
hidden:
created: true
field_media_video_file: true
name: true
uid: true
@@ -0,0 +1,26 @@
langcode: en
status: true
dependencies:
config:
- field.storage.media.field_media_audio_file
- media.type.audio
module:
- file
id: media.audio.field_media_audio_file
field_name: field_media_audio_file
entity_type: media
bundle: audio
label: 'Audio file'
description: ''
required: true
translatable: true
default_value: { }
default_value_callback: ''
settings:
handler: 'default:file'
handler_settings: { }
file_directory: '[date:custom:Y]-[date:custom:m]'
file_extensions: 'mp3 wav aac'
max_filesize: ''
description_field: false
field_type: file
@@ -0,0 +1,29 @@
langcode: en
status: true
dependencies:
config:
- field.storage.media.field_media_document
- media.type.document
module:
- file
enforced:
module:
- media
id: media.document.field_media_document
field_name: field_media_document
entity_type: media
bundle: document
label: Document
description: ''
required: true
translatable: true
default_value: { }
default_value_callback: ''
settings:
handler: 'default:file'
handler_settings: { }
file_directory: '[date:custom:Y]-[date:custom:m]'
file_extensions: 'txt rtf doc docx ppt pptx xls xlsx pdf odf odg odp ods odt fodt fods fodp fodg key numbers pages'
max_filesize: ''
description_field: false
field_type: file
@@ -0,0 +1,40 @@
langcode: en
status: true
dependencies:
config:
- field.storage.media.field_media_image
- media.type.image
module:
- image
enforced:
module:
- media
id: media.image.field_media_image
field_name: field_media_image
entity_type: media
bundle: image
label: Image
description: ''
required: true
translatable: true
default_value: { }
default_value_callback: ''
settings:
handler: 'default:file'
handler_settings: { }
file_directory: '[date:custom:Y]-[date:custom:m]'
file_extensions: 'png gif jpg jpeg webp'
max_filesize: ''
max_resolution: ''
min_resolution: ''
alt_field: true
alt_field_required: true
title_field: false
title_field_required: false
default_image:
uuid: null
alt: ''
title: ''
width: null
height: null
field_type: image
@@ -0,0 +1,18 @@
langcode: en
status: true
dependencies:
config:
- field.storage.media.field_media_oembed_video
- media.type.remote_video
id: media.remote_video.field_media_oembed_video
field_name: field_media_oembed_video
entity_type: media
bundle: remote_video
label: 'Video URL'
description: ''
required: true
translatable: true
default_value: { }
default_value_callback: ''
settings: { }
field_type: string
@@ -0,0 +1,26 @@
langcode: en
status: true
dependencies:
config:
- field.storage.media.field_media_video_file
- media.type.video
module:
- file
id: media.video.field_media_video_file
field_name: field_media_video_file
entity_type: media
bundle: video
label: 'Video file'
description: ''
required: true
translatable: true
default_value: { }
default_value_callback: ''
settings:
handler: 'default:file'
handler_settings: { }
file_directory: '[date:custom:Y]-[date:custom:m]'
file_extensions: mp4
max_filesize: ''
description_field: false
field_type: file
@@ -0,0 +1,22 @@
langcode: en
status: true
dependencies:
module:
- file
- media
id: media.field_media_audio_file
field_name: field_media_audio_file
entity_type: media
type: file
settings:
target_type: file
display_field: false
display_default: false
uri_scheme: public
module: file
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
@@ -0,0 +1,25 @@
langcode: en
status: true
dependencies:
module:
- file
- media
enforced:
module:
- media
id: media.field_media_document
field_name: field_media_document
entity_type: media
type: file
settings:
target_type: file
display_field: false
display_default: false
uri_scheme: public
module: file
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
@@ -0,0 +1,32 @@
langcode: en
status: true
dependencies:
module:
- file
- image
- media
enforced:
module:
- media
id: media.field_media_image
field_name: field_media_image
entity_type: media
type: image
settings:
target_type: file
display_field: false
display_default: false
uri_scheme: public
default_image:
uuid: null
alt: ''
title: ''
width: null
height: null
module: image
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
@@ -0,0 +1,20 @@
langcode: en
status: true
dependencies:
module:
- media
id: media.field_media_oembed_video
field_name: field_media_oembed_video
entity_type: media
type: string
settings:
max_length: 255
case_sensitive: false
is_ascii: false
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
@@ -0,0 +1,22 @@
langcode: en
status: true
dependencies:
module:
- file
- media
id: media.field_media_video_file
field_name: field_media_video_file
entity_type: media
type: file
settings:
target_type: file
display_field: false
display_default: false
uri_scheme: public
module: file
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
@@ -0,0 +1,24 @@
langcode: en
dependencies:
module:
- responsive_image
enforced:
module:
- responsive_image
name: max_1300x1300
label: 'Max 1300x1300'
effects:
04caae9a-fa3e-4ea6-ae09-9c26aec7d308:
uuid: 04caae9a-fa3e-4ea6-ae09-9c26aec7d308
id: image_scale
weight: 1
data:
width: 1300
height: 1300
upscale: false
e8c9d6ba-a017-4a87-9999-7ce52e138e1d:
uuid: e8c9d6ba-a017-4a87-9999-7ce52e138e1d
id: image_convert
weight: 2
data:
extension: webp
@@ -0,0 +1,24 @@
langcode: en
dependencies:
module:
- responsive_image
enforced:
module:
- responsive_image
name: max_2600x2600
label: 'Max 2600x2600'
effects:
9b311dd1-0351-45a1-9500-cd069e4670cb:
uuid: 9b311dd1-0351-45a1-9500-cd069e4670cb
id: image_scale
weight: 1
data:
width: 2600
height: 2600
upscale: false
3c42f186-7beb-4dbf-b720-bff9dfeaa677:
uuid: 3c42f186-7beb-4dbf-b720-bff9dfeaa677
id: image_convert
weight: 2
data:
extension: webp
@@ -0,0 +1,24 @@
langcode: en
dependencies:
module:
- responsive_image
enforced:
module:
- responsive_image
name: max_325x325
label: 'Max 325x325'
effects:
cb842cc8-682f-42a6-bd05-5a1ac726f0d8:
uuid: cb842cc8-682f-42a6-bd05-5a1ac726f0d8
id: image_scale
weight: 1
data:
width: 325
height: 325
upscale: false
f2b6c795-26ae-4130-aa18-aa120ea3ba98:
uuid: f2b6c795-26ae-4130-aa18-aa120ea3ba98
id: image_convert
weight: 2
data:
extension: webp
@@ -0,0 +1,24 @@
langcode: en
dependencies:
module:
- responsive_image
enforced:
module:
- responsive_image
name: max_650x650
label: 'Max 650x650'
effects:
949c201a-77f5-48f6-ba00-be91eb1aad47:
uuid: 949c201a-77f5-48f6-ba00-be91eb1aad47
id: image_scale
weight: 1
data:
width: 650
height: 650
upscale: false
4a2a7af8-8ea3-419d-b5f8-256d57016102:
uuid: 4a2a7af8-8ea3-419d-b5f8-256d57016102
id: image_convert
weight: 2
data:
extension: webp
@@ -0,0 +1,13 @@
langcode: en
status: true
dependencies: { }
id: audio
label: Audio
description: 'A locally hosted audio file.'
source: audio_file
queue_thumbnail_downloads: false
new_revision: true
source_configuration:
source_field: field_media_audio_file
field_map:
name: name
@@ -0,0 +1,13 @@
langcode: en
status: true
dependencies: { }
id: document
label: Document
description: "An uploaded file or document, such as a PDF."
source: file
queue_thumbnail_downloads: false
new_revision: true
source_configuration:
source_field: field_media_document
field_map:
name: name
@@ -0,0 +1,13 @@
langcode: en
status: true
dependencies: { }
id: image
label: Image
description: "Use local images for reusable media."
source: image
queue_thumbnail_downloads: false
new_revision: true
source_configuration:
source_field: field_media_image
field_map:
name: name
@@ -0,0 +1,17 @@
langcode: en
status: true
dependencies: { }
id: remote_video
label: 'Remote video'
description: 'A remotely hosted video from YouTube or Vimeo.'
source: 'oembed:video'
queue_thumbnail_downloads: false
new_revision: true
source_configuration:
source_field: field_media_oembed_video
thumbnails_directory: 'public://oembed_thumbnails/[date:custom:Y-m]'
providers:
- YouTube
- Vimeo
field_map:
title: name
@@ -0,0 +1,13 @@
langcode: en
status: true
dependencies: { }
id: video
label: Video
description: 'A locally hosted video file.'
source: video_file
queue_thumbnail_downloads: false
new_revision: true
source_configuration:
source_field: field_media_video_file
field_map:
name: name
@@ -0,0 +1,23 @@
uuid: 8eb79e19-da57-4bd3-8304-4e0b5a147276
langcode: en
status: true
dependencies:
config:
- image.style.max_1300x1300
- image.style.max_650x650
- image.style.max_325x325
id: narrow
label: Narrow
image_style_mappings:
-
image_mapping_type: sizes
image_mapping:
sizes: '(min-width: 1290px) 325px, (min-width: 851px) 25vw, (min-width: 560px) 50vw, 100vw'
sizes_image_styles:
- max_1300x1300
- max_650x650
- max_325x325
breakpoint_id: responsive_image.viewport_sizing
multiplier: 1x
breakpoint_group: responsive_image
fallback_image_style: max_325x325
@@ -0,0 +1,25 @@
uuid: 5cffd3ef-5656-4446-b200-b771d8076568
langcode: en
status: true
dependencies:
config:
- image.style.max_2600x2600
- image.style.max_1300x1300
- image.style.max_650x650
- image.style.max_325x325
id: wide
label: Wide
image_style_mappings:
-
image_mapping_type: sizes
image_mapping:
sizes: '(min-width: 1290px) 1290px, 100vw'
sizes_image_styles:
- max_2600x2600
- max_1300x1300
- max_650x650
- max_325x325
breakpoint_id: responsive_image.viewport_sizing
multiplier: 1x
breakpoint_group: responsive_image
fallback_image_style: max_325x325
@@ -0,0 +1,60 @@
langcode: en
status: true
dependencies:
module:
- content_moderation
id: editorial
label: Editorial
type: content_moderation
type_settings:
states:
archived:
label: Archived
weight: 5
published: false
default_revision: true
draft:
label: Draft
weight: -5
published: false
default_revision: false
published:
label: Published
weight: 0
published: true
default_revision: true
transitions:
archive:
label: Archive
from:
- published
to: archived
weight: 2
archived_draft:
label: 'Restore to Draft'
from:
- archived
to: draft
weight: 3
archived_published:
label: Restore
from:
- archived
to: published
weight: 4
create_new_draft:
label: 'Create New Draft'
from:
- draft
- published
to: draft
weight: 0
publish:
label: Publish
from:
- draft
- published
to: published
weight: 1
entity_types: { }
default_moderation_state: draft
@@ -0,0 +1,40 @@
name: Standard
type: profile
description: 'Install with commonly used features pre-configured.'
version: VERSION
install:
- node
- history
- block
- breakpoint
- ckeditor5
- config
- comment
- contextual
- contact
- menu_link_content
- datetime
- block_content
- editor
- help
- image
- menu_ui
- options
- path
- page_cache
- dynamic_page_cache
- big_pipe
- taxonomy
- dblog
- search
- shortcut
- toolbar
- field_ui
- file
- views
- views_ui
- automated_cron
- announcements_feed
themes:
- olivero
- claro
@@ -0,0 +1,34 @@
<?php
/**
* @file
* Install, update and uninstall functions for the standard installation profile.
*/
use Drupal\shortcut\Entity\Shortcut;
/**
* Implements hook_install().
*
* Perform actions to set up the site for this profile.
*
* @see system_install()
*/
function standard_install() {
// Populate the default shortcut set.
$shortcut = Shortcut::create([
'shortcut_set' => 'default',
'title' => t('Add content'),
'weight' => -20,
'link' => ['uri' => 'internal:/node/add'],
]);
$shortcut->save();
$shortcut = Shortcut::create([
'shortcut_set' => 'default',
'title' => t('All content'),
'weight' => -19,
'link' => ['uri' => 'internal:/admin/content'],
]);
$shortcut->save();
}
@@ -0,0 +1,4 @@
standard.front_page:
title: 'Home'
route_name: '<front>'
menu_name: main
@@ -0,0 +1,26 @@
<?php
/**
* @file
* Enables modules and site configuration for a standard site installation.
*/
use Drupal\contact\Entity\ContactForm;
use Drupal\Core\Form\FormStateInterface;
/**
* Implements hook_form_FORM_ID_alter() for install_configure_form().
*
* Allows the profile to alter the site configuration form.
*/
function standard_form_install_configure_form_alter(&$form, FormStateInterface $form_state) {
$form['#submit'][] = 'standard_form_install_configure_submit';
}
/**
* Submission handler to sync the contact.form.feedback recipient.
*/
function standard_form_install_configure_submit($form, FormStateInterface $form_state) {
$site_mail = $form_state->getValue('site_mail');
ContactForm::load('feedback')->setRecipients([$site_mail])->trustData()->save();
}
@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace Drupal\Tests\standard\Functional;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\standard\Traits\StandardTestTrait;
/**
* Tests Standard installation profile expectations.
*
* @group standard
*/
class StandardTest extends BrowserTestBase {
use StandardTestTrait;
protected $profile = 'standard';
}
@@ -0,0 +1,64 @@
<?php
declare(strict_types=1);
namespace Drupal\Tests\standard\FunctionalJavascript;
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
use Drupal\node\Entity\Node;
/**
* Tests Standard installation profile JavaScript expectations.
*
* @group standard
*/
class StandardJavascriptTest extends WebDriverTestBase {
/**
* {@inheritdoc}
*/
protected $profile = 'standard';
/**
* Tests BigPipe accelerates particular Standard installation profile routes.
*/
public function testBigPipe(): void {
$this->drupalLogin($this->drupalCreateUser([
'access content',
'post comments',
'skip comment approval',
]));
$node = Node::create(['type' => 'article'])
->setTitle($this->randomMachineName())
->setPromoted(TRUE)
->setPublished();
$node->save();
// Front page: one placeholder, for messages.
$this->drupalGet('');
$this->assertBigPipePlaceholderReplacementCount(1);
// Node page: 2 placeholders:
// 1. messages
// 2. comment form
$this->drupalGet($node->toUrl());
$this->assertBigPipePlaceholderReplacementCount(2);
}
/**
* Asserts the number of BigPipe placeholders that are replaced on the page.
*
* @param int $expected_count
* The expected number of BigPipe placeholders.
*/
protected function assertBigPipePlaceholderReplacementCount($expected_count): void {
$web_assert = $this->assertSession();
$web_assert->waitForElement('css', 'script[data-big-pipe-event="stop"]');
$page = $this->getSession()->getPage();
// Settings are removed as soon as they are processed.
$this->assertCount(0, $this->getDrupalSettings()['bigPipePlaceholderIds']);
$this->assertCount($expected_count, $page->findAll('css', 'script[data-big-pipe-replacement-for-placeholder-with-id]'));
}
}
@@ -0,0 +1,333 @@
<?php
declare(strict_types=1);
namespace Drupal\Tests\standard\FunctionalJavascript;
use Drupal\Core\Cache\Cache;
use Drupal\FunctionalJavascriptTests\PerformanceTestBase;
use Drupal\Tests\PerformanceData;
use Drupal\node\NodeInterface;
use Drupal\user\UserInterface;
/**
* Tests the performance of basic functionality in the standard profile.
*
* Stark is used as the default theme so that this test is not Olivero specific.
*
* @group Common
* @group #slow
* @requires extension apcu
*/
class StandardPerformanceTest extends PerformanceTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected $profile = 'standard';
/**
* The user account created during testing.
*/
protected ?UserInterface $user = NULL;
/**
* {@inheritdoc}
*/
protected function setUp(): void {
parent::setUp();
// Create a node to be shown on the front page.
$this->drupalCreateNode([
'type' => 'article',
'promote' => NodeInterface::PROMOTED,
]);
// Grant the anonymous user the permission to look at user profiles.
user_role_grant_permissions('anonymous', ['access user profiles']);
}
/**
* Tests performance of the standard profile.
*/
public function testStandardPerformance(): void {
$this->testAnonymous();
$this->testLogin();
$this->testLoginBlock();
}
/**
* Tests performance for anonymous users.
*/
protected function testAnonymous(): void {
// Request the front page, then immediately clear all object caches, so that
// aggregates and image styles are created on disk but otherwise caches are
// empty.
$this->drupalGet('');
// Give time for big pipe placeholders, asset aggregate requests, and post
// response tasks to finish processing and write to any caches before
// clearing caches again.
sleep(2);
foreach (Cache::getBins() as $bin) {
$bin->deleteAll();
}
// Now visit a different page to warm some caches.
$this->drupalGet('user/login');
// Ensure everything finishes before we collect performance data.
sleep(2);
// Test frontpage.
$performance_data = $this->collectPerformanceData(function () {
$this->drupalGet('');
}, 'standardFrontPage');
$this->assertNoJavaScript($performance_data);
$this->assertSame(1, $performance_data->getStylesheetCount());
$this->assertLessThan(3500, $performance_data->getStylesheetBytes());
$expected_queries = [
'SELECT "base_table"."id" AS "id", "base_table"."path" AS "path", "base_table"."alias" AS "alias", "base_table"."langcode" AS "langcode" FROM "path_alias" "base_table" WHERE ("base_table"."status" = 1) AND ("base_table"."alias" LIKE "/node" ESCAPE ' . "'\\\\'" . ') AND ("base_table"."langcode" IN ("en", "und")) ORDER BY "base_table"."langcode" ASC, "base_table"."id" DESC',
'SELECT "name", "route", "fit" FROM "router" WHERE "pattern_outline" IN ( "/node" ) AND "number_parts" >= 1',
'SELECT COUNT(*) AS "expression" FROM (SELECT 1 AS "expression" FROM "node_field_data" "node_field_data" WHERE ("node_field_data"."promote" = 1) AND ("node_field_data"."status" = 1)) "subquery"',
'SELECT "node_field_data"."sticky" AS "node_field_data_sticky", "node_field_data"."created" AS "node_field_data_created", "node_field_data"."nid" AS "nid" FROM "node_field_data" "node_field_data" WHERE ("node_field_data"."promote" = 1) AND ("node_field_data"."status" = 1) ORDER BY "node_field_data_sticky" DESC, "node_field_data_created" DESC LIMIT 10 OFFSET 0',
'SELECT "revision"."vid" AS "vid", "revision"."langcode" AS "langcode", "revision"."revision_uid" AS "revision_uid", "revision"."revision_timestamp" AS "revision_timestamp", "revision"."revision_log" AS "revision_log", "revision"."revision_default" AS "revision_default", "base"."nid" AS "nid", "base"."type" AS "type", "base"."uuid" AS "uuid", CASE "base"."vid" WHEN "revision"."vid" THEN 1 ELSE 0 END AS "isDefaultRevision" FROM "node" "base" INNER JOIN "node_revision" "revision" ON "revision"."vid" = "base"."vid" WHERE "base"."nid" IN (1)',
'SELECT "revision".* FROM "node_field_revision" "revision" WHERE ("revision"."nid" IN (1)) AND ("revision"."vid" IN ("1")) ORDER BY "revision"."nid" ASC',
'SELECT "t".* FROM "node__body" "t" WHERE ("entity_id" IN (1)) AND ("deleted" = 0) AND ("langcode" IN ("en", "und", "zxx")) ORDER BY "delta" ASC',
'SELECT "t".* FROM "node__comment" "t" WHERE ("entity_id" IN (1)) AND ("deleted" = 0) AND ("langcode" IN ("en", "und", "zxx")) ORDER BY "delta" ASC',
'SELECT "t".* FROM "node__field_image" "t" WHERE ("entity_id" IN (1)) AND ("deleted" = 0) AND ("langcode" IN ("en", "und", "zxx")) ORDER BY "delta" ASC',
'SELECT "t".* FROM "node__field_tags" "t" WHERE ("entity_id" IN (1)) AND ("deleted" = 0) AND ("langcode" IN ("en", "und", "zxx")) ORDER BY "delta" ASC',
'SELECT "ces".* FROM "comment_entity_statistics" "ces" WHERE ("ces"."entity_id" IN (1)) AND ("ces"."entity_type" = "node")',
'SELECT "name", "data" FROM "config" WHERE "collection" = "" AND "name" IN ( "core.entity_view_display.node.article.teaser", "core.entity_view_display.node.article.default" )',
'SELECT "config"."name" AS "name" FROM "config" "config" WHERE ("collection" = "") AND ("name" LIKE "comment.type.%" ESCAPE ' . "'\\\\'" . ') ORDER BY "collection" ASC, "name" ASC',
'SELECT "config"."name" AS "name" FROM "config" "config" WHERE ("collection" = "") AND ("name" LIKE "node.type.%" ESCAPE ' . "'\\\\'" . ') ORDER BY "collection" ASC, "name" ASC',
'SELECT "base"."uid" AS "uid", "base"."uuid" AS "uuid", "base"."langcode" AS "langcode" FROM "users" "base" WHERE "base"."uid" IN (0)',
'SELECT "data".* FROM "users_field_data" "data" WHERE "data"."uid" IN (0) ORDER BY "data"."uid" ASC',
'SELECT "t".* FROM "user__roles" "t" WHERE ("entity_id" IN (0)) AND ("deleted" = 0) AND ("langcode" IN ("en", "und", "zxx")) ORDER BY "delta" ASC',
'SELECT "t".* FROM "user__user_picture" "t" WHERE ("entity_id" IN (0)) AND ("deleted" = 0) AND ("langcode" IN ("en", "und", "zxx")) ORDER BY "delta" ASC',
'SELECT "name", "data" FROM "config" WHERE "collection" = "" AND "name" IN ( "core.date_format.medium" )',
'SELECT "name", "data" FROM "config" WHERE "collection" = "" AND "name" IN ( "core.date_format.long" )',
'SELECT 1 AS "expression" FROM "path_alias" "base_table" WHERE ("base_table"."status" = 1) AND ("base_table"."path" LIKE "/node%" ESCAPE ' . "'\\\\'" . ') LIMIT 1 OFFSET 0',
'SELECT "name", "data" FROM "config" WHERE "collection" = "" AND "name" IN ( "core.entity_view_display.user.user.compact", "core.entity_view_display.user.user.default" )',
'SELECT "name", "data" FROM "config" WHERE "collection" = "" AND "name" IN ( "filter.format.restricted_html" )',
'SELECT "name", "data" FROM "config" WHERE "collection" = "" AND "name" IN ( "system.image" )',
'SELECT "name", "data" FROM "config" WHERE "collection" = "" AND "name" IN ( "user.role.authenticated" )',
'SELECT "name", "value" FROM "key_value" WHERE "name" IN ( "theme:stark" ) AND "collection" = "config.entity.key_store.block"',
'SELECT "menu_tree"."menu_name" AS "menu_name", "menu_tree"."route_name" AS "route_name", "menu_tree"."route_parameters" AS "route_parameters", "menu_tree"."url" AS "url", "menu_tree"."title" AS "title", "menu_tree"."description" AS "description", "menu_tree"."parent" AS "parent", "menu_tree"."weight" AS "weight", "menu_tree"."options" AS "options", "menu_tree"."expanded" AS "expanded", "menu_tree"."enabled" AS "enabled", "menu_tree"."provider" AS "provider", "menu_tree"."metadata" AS "metadata", "menu_tree"."class" AS "class", "menu_tree"."form_class" AS "form_class", "menu_tree"."id" AS "id" FROM "menu_tree" "menu_tree" WHERE ("route_name" = "view.frontpage.page_1") AND ("route_param_key" = "view_id=frontpage&display_id=page_1") AND ("menu_name" = "main") ORDER BY "depth" ASC, "weight" ASC, "id" ASC',
'SELECT "menu_tree"."menu_name" AS "menu_name", "menu_tree"."route_name" AS "route_name", "menu_tree"."route_parameters" AS "route_parameters", "menu_tree"."url" AS "url", "menu_tree"."title" AS "title", "menu_tree"."description" AS "description", "menu_tree"."parent" AS "parent", "menu_tree"."weight" AS "weight", "menu_tree"."options" AS "options", "menu_tree"."expanded" AS "expanded", "menu_tree"."enabled" AS "enabled", "menu_tree"."provider" AS "provider", "menu_tree"."metadata" AS "metadata", "menu_tree"."class" AS "class", "menu_tree"."form_class" AS "form_class", "menu_tree"."id" AS "id" FROM "menu_tree" "menu_tree" WHERE ("route_name" = "view.frontpage.page_1") AND ("route_param_key" = "view_id=frontpage&display_id=page_1") AND ("menu_name" = "account") ORDER BY "depth" ASC, "weight" ASC, "id" ASC',
'INSERT INTO "semaphore" ("name", "value", "expire") VALUES ("theme_registry:runtime:stark:Drupal\Core\Utility\ThemeRegistry", "LOCK_ID", "EXPIRE")',
'DELETE FROM "semaphore" WHERE ("name" = "theme_registry:runtime:stark:Drupal\Core\Utility\ThemeRegistry") AND ("value" = "LOCK_ID")',
'INSERT INTO "semaphore" ("name", "value", "expire") VALUES ("library_info:stark:Drupal\Core\Cache\CacheCollector", "LOCK_ID", "EXPIRE")',
'DELETE FROM "semaphore" WHERE ("name" = "library_info:stark:Drupal\Core\Cache\CacheCollector") AND ("value" = "LOCK_ID")',
'INSERT INTO "semaphore" ("name", "value", "expire") VALUES ("path_alias_whitelist:Drupal\Core\Cache\CacheCollector", "LOCK_ID", "EXPIRE")',
'DELETE FROM "semaphore" WHERE ("name" = "path_alias_whitelist:Drupal\Core\Cache\CacheCollector") AND ("value" = "LOCK_ID")',
];
$recorded_queries = $performance_data->getQueries();
$this->assertSame($expected_queries, $recorded_queries);
$this->assertSame(34, $performance_data->getQueryCount());
$this->assertSame(124, $performance_data->getCacheGetCount());
$this->assertSame(45, $performance_data->getCacheSetCount());
$this->assertSame(0, $performance_data->getCacheDeleteCount());
$this->assertSame(36, $performance_data->getCacheTagChecksumCount());
$this->assertSame(43, $performance_data->getCacheTagIsValidCount());
$this->assertSame(0, $performance_data->getCacheTagInvalidationCount());
// Test node page.
$performance_data = $this->collectPerformanceData(function () {
$this->drupalGet('node/1');
}, 'standardNodePage');
$this->assertNoJavaScript($performance_data);
$this->assertSame(1, $performance_data->getStylesheetCount());
$this->assertLessThan(3500, $performance_data->getStylesheetBytes());
$expected_queries = [
'SELECT "base_table"."id" AS "id", "base_table"."path" AS "path", "base_table"."alias" AS "alias", "base_table"."langcode" AS "langcode" FROM "path_alias" "base_table" WHERE ("base_table"."status" = 1) AND ("base_table"."alias" LIKE "/node/1" ESCAPE ' . "'\\\\'" . ') AND ("base_table"."langcode" IN ("en", "und")) ORDER BY "base_table"."langcode" ASC, "base_table"."id" DESC',
'SELECT "name", "route", "fit" FROM "router" WHERE "pattern_outline" IN ( "/node/1", "/node/%", "/node" ) AND "number_parts" >= 2',
'SELECT "name", "data" FROM "config" WHERE "collection" = "" AND "name" IN ( "core.entity_view_display.node.article.full" )',
'SELECT "name", "value" FROM "key_value" WHERE "name" IN ( "theme:stark" ) AND "collection" = "config.entity.key_store.block"',
'SELECT "menu_tree"."menu_name" AS "menu_name", "menu_tree"."route_name" AS "route_name", "menu_tree"."route_parameters" AS "route_parameters", "menu_tree"."url" AS "url", "menu_tree"."title" AS "title", "menu_tree"."description" AS "description", "menu_tree"."parent" AS "parent", "menu_tree"."weight" AS "weight", "menu_tree"."options" AS "options", "menu_tree"."expanded" AS "expanded", "menu_tree"."enabled" AS "enabled", "menu_tree"."provider" AS "provider", "menu_tree"."metadata" AS "metadata", "menu_tree"."class" AS "class", "menu_tree"."form_class" AS "form_class", "menu_tree"."id" AS "id" FROM "menu_tree" "menu_tree" WHERE ("route_name" = "entity.node.canonical") AND ("route_param_key" = "node=1") AND ("menu_name" = "main") ORDER BY "depth" ASC, "weight" ASC, "id" ASC',
'SELECT "menu_tree"."menu_name" AS "menu_name", "menu_tree"."route_name" AS "route_name", "menu_tree"."route_parameters" AS "route_parameters", "menu_tree"."url" AS "url", "menu_tree"."title" AS "title", "menu_tree"."description" AS "description", "menu_tree"."parent" AS "parent", "menu_tree"."weight" AS "weight", "menu_tree"."options" AS "options", "menu_tree"."expanded" AS "expanded", "menu_tree"."enabled" AS "enabled", "menu_tree"."provider" AS "provider", "menu_tree"."metadata" AS "metadata", "menu_tree"."class" AS "class", "menu_tree"."form_class" AS "form_class", "menu_tree"."id" AS "id" FROM "menu_tree" "menu_tree" WHERE ("route_name" = "entity.node.canonical") AND ("route_param_key" = "node=1") AND ("menu_name" = "account") ORDER BY "depth" ASC, "weight" ASC, "id" ASC',
'INSERT INTO "semaphore" ("name", "value", "expire") VALUES ("theme_registry:runtime:stark:Drupal\Core\Utility\ThemeRegistry", "LOCK_ID", "EXPIRE")',
'DELETE FROM "semaphore" WHERE ("name" = "theme_registry:runtime:stark:Drupal\Core\Utility\ThemeRegistry") AND ("value" = "LOCK_ID")',
];
$recorded_queries = $performance_data->getQueries();
$this->assertSame($expected_queries, $recorded_queries);
$this->assertSame(8, $performance_data->getQueryCount());
$this->assertSame(94, $performance_data->getCacheGetCount());
$this->assertSame(16, $performance_data->getCacheSetCount());
$this->assertSame(0, $performance_data->getCacheDeleteCount());
$this->assertCountBetween(23, 24, $performance_data->getCacheTagChecksumCount());
$this->assertCountBetween(39, 40, $performance_data->getCacheTagIsValidCount());
$this->assertSame(0, $performance_data->getCacheTagInvalidationCount());
// Test user profile page.
$this->user = $this->drupalCreateUser();
$performance_data = $this->collectPerformanceData(function () {
$this->drupalGet('user/' . $this->user->id());
}, 'standardUserPage');
$this->assertNoJavaScript($performance_data);
$this->assertSame(1, $performance_data->getStylesheetCount());
$this->assertLessThan(3500, $performance_data->getStylesheetBytes());
$expected_queries = [
'SELECT "base_table"."id" AS "id", "base_table"."path" AS "path", "base_table"."alias" AS "alias", "base_table"."langcode" AS "langcode" FROM "path_alias" "base_table" WHERE ("base_table"."status" = 1) AND ("base_table"."alias" LIKE "/user/2" ESCAPE ' . "'\\\\'" . ') AND ("base_table"."langcode" IN ("en", "und")) ORDER BY "base_table"."langcode" ASC, "base_table"."id" DESC',
'SELECT "name", "route", "fit" FROM "router" WHERE "pattern_outline" IN ( "/user/2", "/user/%", "/user" ) AND "number_parts" >= 2',
'SELECT "base"."uid" AS "uid", "base"."uuid" AS "uuid", "base"."langcode" AS "langcode" FROM "users" "base" WHERE "base"."uid" IN (2)',
'SELECT "data".* FROM "users_field_data" "data" WHERE "data"."uid" IN (2) ORDER BY "data"."uid" ASC',
'SELECT "t".* FROM "user__roles" "t" WHERE ("entity_id" IN (2)) AND ("deleted" = 0) AND ("langcode" IN ("en", "und", "zxx")) ORDER BY "delta" ASC',
'SELECT "t".* FROM "user__user_picture" "t" WHERE ("entity_id" IN (2)) AND ("deleted" = 0) AND ("langcode" IN ("en", "und", "zxx")) ORDER BY "delta" ASC',
'SELECT "name", "data" FROM "config" WHERE "collection" = "" AND "name" IN ( "core.entity_view_display.user.user.full" )',
'SELECT "name", "value" FROM "key_value" WHERE "name" IN ( "theme:stark" ) AND "collection" = "config.entity.key_store.block"',
'SELECT "menu_tree"."menu_name" AS "menu_name", "menu_tree"."route_name" AS "route_name", "menu_tree"."route_parameters" AS "route_parameters", "menu_tree"."url" AS "url", "menu_tree"."title" AS "title", "menu_tree"."description" AS "description", "menu_tree"."parent" AS "parent", "menu_tree"."weight" AS "weight", "menu_tree"."options" AS "options", "menu_tree"."expanded" AS "expanded", "menu_tree"."enabled" AS "enabled", "menu_tree"."provider" AS "provider", "menu_tree"."metadata" AS "metadata", "menu_tree"."class" AS "class", "menu_tree"."form_class" AS "form_class", "menu_tree"."id" AS "id" FROM "menu_tree" "menu_tree" WHERE ("route_name" = "entity.user.canonical") AND ("route_param_key" = "user=2") AND ("menu_name" = "main") ORDER BY "depth" ASC, "weight" ASC, "id" ASC',
'SELECT "menu_tree"."menu_name" AS "menu_name", "menu_tree"."route_name" AS "route_name", "menu_tree"."route_parameters" AS "route_parameters", "menu_tree"."url" AS "url", "menu_tree"."title" AS "title", "menu_tree"."description" AS "description", "menu_tree"."parent" AS "parent", "menu_tree"."weight" AS "weight", "menu_tree"."options" AS "options", "menu_tree"."expanded" AS "expanded", "menu_tree"."enabled" AS "enabled", "menu_tree"."provider" AS "provider", "menu_tree"."metadata" AS "metadata", "menu_tree"."class" AS "class", "menu_tree"."form_class" AS "form_class", "menu_tree"."id" AS "id" FROM "menu_tree" "menu_tree" WHERE ("route_name" = "entity.user.canonical") AND ("route_param_key" = "user=2") AND ("menu_name" = "account") ORDER BY "depth" ASC, "weight" ASC, "id" ASC',
'SELECT "ud".* FROM "users_data" "ud" WHERE ("module" = "contact") AND ("uid" = "2") AND ("name" = "enabled")',
'SELECT "name", "data" FROM "config" WHERE "collection" = "" AND "name" IN ( "contact.settings" )',
];
$recorded_queries = $performance_data->getQueries();
$this->assertSame($expected_queries, $recorded_queries);
$this->assertSame(12, $performance_data->getQueryCount());
$this->assertSame(76, $performance_data->getCacheGetCount());
$this->assertSame(15, $performance_data->getCacheSetCount());
$this->assertSame(0, $performance_data->getCacheDeleteCount());
$this->assertSame(21, $performance_data->getCacheTagChecksumCount());
$this->assertSame(33, $performance_data->getCacheTagIsValidCount());
$this->assertSame(0, $performance_data->getCacheTagInvalidationCount());
}
/**
* Tests the performance of logging in.
*/
protected function testLogin(): void {
// Create a user and log them in to warm all caches. Manually submit the
// form so that we repeat the same steps when recording performance data. Do
// this twice so that any caches which take two requests to warm are also
// covered.
foreach (range(0, 1) as $index) {
$this->drupalGet('node');
$this->drupalGet('user/login');
$this->submitLoginForm($this->user);
$this->drupalLogout();
}
$this->drupalGet('node');
$this->drupalGet('user/login');
$performance_data = $this->collectPerformanceData(function () {
$this->submitLoginForm($this->user);
}, 'standardLogin');
$expected_queries = [
'SELECT "name", "value" FROM "key_value_expire" WHERE "expire" > "NOW" AND "name" IN ( "KEY" ) AND "collection" = "form"',
'SELECT COUNT(*) AS "expression" FROM (SELECT 1 AS "expression" FROM "flood" "f" WHERE ("event" = "user.failed_login_ip") AND ("identifier" = "CLIENT_IP") AND ("timestamp" > "TIMESTAMP")) "subquery"',
'SELECT "base_table"."uid" AS "uid", "base_table"."uid" AS "base_table_uid" FROM "users" "base_table" INNER JOIN "users_field_data" "users_field_data" ON "users_field_data"."uid" = "base_table"."uid" WHERE ("users_field_data"."name" IN ("ACCOUNT_NAME")) AND ("users_field_data"."default_langcode" IN (1))',
'SELECT COUNT(*) AS "expression" FROM (SELECT 1 AS "expression" FROM "flood" "f" WHERE ("event" = "user.failed_login_user") AND ("identifier" = "CLIENT_IP") AND ("timestamp" > "TIMESTAMP")) "subquery"',
'INSERT INTO "watchdog" ("uid", "type", "message", "variables", "severity", "link", "location", "referer", "hostname", "timestamp") VALUES ("2", "user", "Session opened for %name.", "WATCHDOG_DATA", 6, "", "LOCATION", "REFERER", "CLIENT_IP", "TIMESTAMP")',
'UPDATE "users_field_data" SET "login"="TIMESTAMP" WHERE "uid" = "2"',
'SELECT "session" FROM "sessions" WHERE "sid" = "SESSION_ID" LIMIT 0, 1',
'SELECT 1 AS "expression" FROM "sessions" "sessions" WHERE "sid" = "SESSION_ID"',
'INSERT INTO "sessions" ("sid", "uid", "hostname", "session", "timestamp") VALUES ("SESSION_ID", "2", "CLIENT_IP", "SESSION_DATA", "TIMESTAMP")',
'SELECT "session" FROM "sessions" WHERE "sid" = "SESSION_ID" LIMIT 0, 1',
'SELECT * FROM "users_field_data" "u" WHERE "u"."uid" = "2" AND "u"."default_langcode" = 1',
'SELECT "roles_target_id" FROM "user__roles" WHERE "entity_id" = "2"',
'SELECT "base"."uid" AS "uid", "base"."uuid" AS "uuid", "base"."langcode" AS "langcode" FROM "users" "base" WHERE "base"."uid" IN (2)',
'SELECT "data".* FROM "users_field_data" "data" WHERE "data"."uid" IN (2) ORDER BY "data"."uid" ASC',
'SELECT "t".* FROM "user__roles" "t" WHERE ("entity_id" IN (2)) AND ("deleted" = 0) AND ("langcode" IN ("en", "und", "zxx")) ORDER BY "delta" ASC',
'SELECT "t".* FROM "user__user_picture" "t" WHERE ("entity_id" IN (2)) AND ("deleted" = 0) AND ("langcode" IN ("en", "und", "zxx")) ORDER BY "delta" ASC',
];
$recorded_queries = $performance_data->getQueries();
$this->assertSame($expected_queries, $recorded_queries);
$this->assertSame(16, $performance_data->getQueryCount());
$this->assertSame(60, $performance_data->getCacheGetCount());
$this->assertSame(1, $performance_data->getCacheSetCount());
$this->assertSame(1, $performance_data->getCacheDeleteCount());
$this->assertSame(1, $performance_data->getCacheTagChecksumCount());
$this->assertSame(23, $performance_data->getCacheTagIsValidCount());
$this->assertSame(0, $performance_data->getCacheTagInvalidationCount());
$this->drupalLogout();
}
/**
* Tests the performance of logging in via the user login block.
*/
protected function testLoginBlock(): void {
$this->drupalPlaceBlock('user_login_block');
// Log the user in in to warm all caches. Manually submit the form so that
// we repeat the same steps when recording performance data. Do this twice
// so that any caches which take two requests to warm are also covered.
foreach (range(0, 1) as $index) {
$this->drupalGet('node');
$this->assertSession()->responseContains('Password');
$this->submitLoginForm($this->user);
$this->drupalLogout();
}
$this->drupalGet('node');
$this->assertSession()->responseContains('Password');
$performance_data = $this->collectPerformanceData(function () {
$this->submitLoginForm($this->user);
}, 'standardBlockLogin');
$expected_queries = [
'SELECT "name", "value" FROM "key_value" WHERE "name" IN ( "theme:stark" ) AND "collection" = "config.entity.key_store.block"',
'SELECT "config"."name" AS "name" FROM "config" "config" WHERE ("collection" = "") AND ("name" LIKE "search.page.%" ESCAPE ' . "'\\\\'" . ') ORDER BY "collection" ASC, "name" ASC',
'SELECT "name", "value" FROM "key_value_expire" WHERE "expire" > "NOW" AND "name" IN ( "KEY" ) AND "collection" = "form"',
'SELECT COUNT(*) AS "expression" FROM (SELECT 1 AS "expression" FROM "flood" "f" WHERE ("event" = "user.failed_login_ip") AND ("identifier" = "CLIENT_IP") AND ("timestamp" > "TIMESTAMP")) "subquery"',
'SELECT "base_table"."uid" AS "uid", "base_table"."uid" AS "base_table_uid" FROM "users" "base_table" INNER JOIN "users_field_data" "users_field_data" ON "users_field_data"."uid" = "base_table"."uid" WHERE ("users_field_data"."name" IN ("ACCOUNT_NAME")) AND ("users_field_data"."default_langcode" IN (1))',
'SELECT "base"."uid" AS "uid", "base"."uuid" AS "uuid", "base"."langcode" AS "langcode" FROM "users" "base" WHERE "base"."uid" IN (2)',
'SELECT "data".* FROM "users_field_data" "data" WHERE "data"."uid" IN (2) ORDER BY "data"."uid" ASC',
'SELECT "t".* FROM "user__roles" "t" WHERE ("entity_id" IN (2)) AND ("deleted" = 0) AND ("langcode" IN ("en", "und", "zxx")) ORDER BY "delta" ASC',
'SELECT "t".* FROM "user__user_picture" "t" WHERE ("entity_id" IN (2)) AND ("deleted" = 0) AND ("langcode" IN ("en", "und", "zxx")) ORDER BY "delta" ASC',
'SELECT COUNT(*) AS "expression" FROM (SELECT 1 AS "expression" FROM "flood" "f" WHERE ("event" = "user.failed_login_user") AND ("identifier" = "CLIENT_IP") AND ("timestamp" > "TIMESTAMP")) "subquery"',
'INSERT INTO "watchdog" ("uid", "type", "message", "variables", "severity", "link", "location", "referer", "hostname", "timestamp") VALUES ("2", "user", "Session opened for %name.", "WATCHDOG_DATA", 6, "", "LOCATION", "REFERER", "CLIENT_IP", "TIMESTAMP")',
'UPDATE "users_field_data" SET "login"="TIMESTAMP" WHERE "uid" = "2"',
'SELECT "session" FROM "sessions" WHERE "sid" = "SESSION_ID" LIMIT 0, 1',
'SELECT 1 AS "expression" FROM "sessions" "sessions" WHERE "sid" = "SESSION_ID"',
'INSERT INTO "sessions" ("sid", "uid", "hostname", "session", "timestamp") VALUES ("SESSION_ID", "2", "CLIENT_IP", "SESSION_DATA", "TIMESTAMP")',
'SELECT "session" FROM "sessions" WHERE "sid" = "SESSION_ID" LIMIT 0, 1',
'SELECT * FROM "users_field_data" "u" WHERE "u"."uid" = "2" AND "u"."default_langcode" = 1',
'SELECT "roles_target_id" FROM "user__roles" WHERE "entity_id" = "2"',
];
$recorded_queries = $performance_data->getQueries();
$this->assertSame($expected_queries, $recorded_queries);
$this->assertSame(18, $performance_data->getQueryCount());
$this->assertSame(107, $performance_data->getCacheGetCount());
$this->assertSame(1, $performance_data->getCacheSetCount());
$this->assertSame(1, $performance_data->getCacheDeleteCount());
$this->assertSame(1, $performance_data->getCacheTagChecksumCount());
$this->assertSame(43, $performance_data->getCacheTagIsValidCount());
$this->assertSame(0, $performance_data->getCacheTagInvalidationCount());
}
/**
* Submit the user login form.
*/
protected function submitLoginForm($account) {
$this->submitForm([
'name' => $account->getAccountName(),
'pass' => $account->passRaw,
], 'Log in');
}
/**
* Passes if no JavaScript is found on the page.
*
* @param Drupal\Tests\PerformanceData $performance_data
* A PerformanceData value object.
*
* @internal
*/
protected function assertNoJavaScript(PerformanceData $performance_data): void {
// Ensure drupalSettings is not set.
$settings = $this->getDrupalSettings();
$this->assertEmpty($settings, 'drupalSettings is not set.');
$this->assertSession()->responseNotMatches('/\.js/');
$this->assertSame(0, $performance_data->getScriptCount());
}
/**
* Provides an empty implementation to prevent the resetting of caches.
*/
protected function refreshVariables() {}
}
@@ -0,0 +1,315 @@
<?php
declare(strict_types=1);
namespace Drupal\Tests\standard\Traits;
use Drupal\ckeditor5\Plugin\Editor\CKEditor5;
use Drupal\Component\Utility\Html;
use Drupal\contact\Entity\ContactForm;
use Drupal\Core\Url;
use Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber;
use Drupal\editor\Entity\Editor;
use Drupal\filter\Entity\FilterFormat;
use Drupal\image\Entity\ImageStyle;
use Drupal\media\Entity\MediaType;
use Drupal\media\Plugin\media\Source\Image;
use Drupal\Tests\RequirementsPageTrait;
use Drupal\Tests\SchemaCheckTestTrait;
use Drupal\user\Entity\Role;
use Drupal\user\Entity\User;
use Symfony\Component\Validator\ConstraintViolation;
/**
* Provides a test method to test the Standard installation profile or recipe.
*/
trait StandardTestTrait {
use SchemaCheckTestTrait;
use RequirementsPageTrait;
/**
* The admin user.
*
* @var \Drupal\user\UserInterface
*/
protected $adminUser;
/**
* Tests Standard installation profile or recipe.
*/
public function testStandard(): void {
$this->drupalGet('');
$this->assertSession()->pageTextContains('Powered by Drupal');
$this->assertSession()->pageTextContains('Congratulations and welcome to the Drupal community.');
// Test anonymous user can access 'Main navigation' block.
$this->adminUser = $this->drupalCreateUser([
'administer blocks',
'administer block content',
'post comments',
'skip comment approval',
'create article content',
'create page content',
]);
$this->drupalLogin($this->adminUser);
// Configure the block.
$this->drupalGet('admin/structure/block/add/system_menu_block:main/olivero');
$this->submitForm([
'region' => 'sidebar',
'id' => 'main_navigation',
], 'Save block');
// Verify admin user can see the block.
$this->drupalGet('');
$this->assertSession()->pageTextContains('Main navigation');
// Verify we have role = complementary on help_block blocks.
$this->drupalGet('admin/structure/block');
$this->assertSession()->elementAttributeContains('xpath', "//div[@id='block-olivero-help']", 'role', 'complementary');
// Verify anonymous user can see the block.
$this->drupalLogout();
$this->assertSession()->pageTextContains('Main navigation');
// Ensure comments don't show in the front page RSS feed.
// Create an article.
$this->drupalCreateNode([
'type' => 'article',
'title' => 'Foobar',
'promote' => 1,
'status' => 1,
'body' => [['value' => 'Then she picked out two somebodies,<br />Sally and me', 'format' => 'basic_html']],
]);
// Add a comment.
$this->drupalLogin($this->adminUser);
$this->drupalGet('node/1');
// Verify that a line break is present.
$this->assertSession()->responseContains('Then she picked out two somebodies,<br>Sally and me');
$this->submitForm([
'subject[0][value]' => 'Bar foo',
'comment_body[0][value]' => 'Then she picked out two somebodies, Sally and me',
], 'Save');
// Fetch the feed.
$this->drupalGet('rss.xml');
$this->assertSession()->responseContains('Foobar');
$this->assertSession()->responseNotContains('Then she picked out two somebodies, Sally and me');
// Ensure block body exists.
$this->drupalGet('block/add');
$this->assertSession()->fieldExists('body[0][value]');
// Now we have all configuration imported, test all of them for schema
// conformance. Ensures all imported default configuration is valid when
// standard profile modules are enabled.
$names = $this->container->get('config.storage')->listAll();
/** @var \Drupal\Core\Config\TypedConfigManagerInterface $typed_config */
$typed_config = $this->container->get('config.typed');
foreach ($names as $name) {
$config = $this->config($name);
$this->assertConfigSchema($typed_config, $name, $config->get());
}
// Validate all configuration.
// @todo Generalize in https://www.drupal.org/project/drupal/issues/2164373
foreach (Editor::loadMultiple() as $editor) {
// Currently only text editors using CKEditor 5 can be validated.
if ($editor->getEditor() !== 'ckeditor5') {
continue;
}
$this->assertSame([], array_map(
function (ConstraintViolation $v) {
return (string) $v->getMessage();
},
iterator_to_array(CKEditor5::validatePair(
$editor,
$editor->getFilterFormat()
))
));
}
// Ensure that configuration from the Standard profile is not reused when
// enabling a module again since it contains configuration that can not be
// installed. For example, editor.editor.basic_html is editor configuration
// that depends on the CKEditor 5 module. The CKEditor 5 module can not be
// installed before the editor module since it depends on the editor module.
// The installer does not have this limitation since it ensures that all of
// the install profiles dependencies are installed before creating the
// editor configuration.
foreach (FilterFormat::loadMultiple() as $filter) {
// Ensure that editor can be uninstalled by removing use in filter
// formats. It is necessary to prime the filter collection before removing
// the filter.
$filter->filters();
$filter->removeFilter('editor_file_reference');
$filter->save();
}
\Drupal::service('module_installer')->uninstall(['editor', 'ckeditor5']);
$this->rebuildContainer();
\Drupal::service('module_installer')->install(['editor']);
/** @var \Drupal\contact\ContactFormInterface $contact_form */
$contact_form = ContactForm::load('feedback');
$recipients = $contact_form->getRecipients();
$this->assertEquals(['[email protected]'], $recipients);
$role = Role::create([
'id' => 'admin_theme',
'label' => 'Admin theme',
]);
$role->grantPermission('view the administration theme');
$role->save();
$this->adminUser->addRole($role->id())->save();
$this->drupalGet('node/add');
$this->assertSession()->statusCodeEquals(200);
// Ensure that there are no pending updates after installation.
$this->drupalLogin($this->rootUser);
$this->drupalGet('update.php/selection');
$this->updateRequirementsProblem();
$this->drupalGet('update.php/selection');
$this->assertSession()->pageTextContains('No pending updates.');
// Ensure that there are no pending entity updates after installation.
$this->assertFalse($this->container->get('entity.definition_update_manager')->needsUpdates(), 'After installation, entity schema is up to date.');
// Make sure the optional image styles are not installed.
$this->drupalGet('admin/config/media/image-styles');
$this->assertSession()->pageTextNotContains('Max 325x325');
$this->assertSession()->pageTextNotContains('Max 650x650');
$this->assertSession()->pageTextNotContains('Max 1300x1300');
$this->assertSession()->pageTextNotContains('Max 2600x2600');
// Make sure the optional image styles are installed after enabling
// the responsive_image module.
$this->installResponsiveImage();
$this->drupalGet('admin/config/media/image-styles');
$this->assertSession()->pageTextContains('Max 325x325');
$this->assertSession()->pageTextContains('Max 650x650');
$this->assertSession()->pageTextContains('Max 1300x1300');
$this->assertSession()->pageTextContains('Max 2600x2600');
// Make sure all image styles has webp conversion as last effect.
foreach (ImageStyle::loadMultiple() as $style) {
$effects = $style->getEffects()->getInstanceIds();
$last = $style->getEffects()->get(end($effects));
$this->assertSame('image_convert', $last->getConfiguration()['id']);
$this->assertSame('webp', $last->getConfiguration()['data']['extension']);
}
// Verify certain routes' responses are cacheable by Dynamic Page Cache, to
// ensure these responses are very fast for authenticated users.
$this->drupalLogin($this->adminUser);
$url = Url::fromRoute('contact.site_page');
$this->drupalGet($url);
// Verify that site-wide contact page cannot be cached by Dynamic Page
// Cache.
$this->assertSession()->responseHeaderEquals(DynamicPageCacheSubscriber::HEADER, 'UNCACHEABLE');
$url = Url::fromRoute('<front>');
$this->drupalGet($url);
$this->drupalGet($url);
// Verify that frontpage is cached by Dynamic Page Cache.
$this->assertSession()->responseHeaderEquals(DynamicPageCacheSubscriber::HEADER, 'HIT');
$url = Url::fromRoute('entity.node.canonical', ['node' => 1]);
$this->drupalGet($url);
$this->drupalGet($url);
// Verify that full node page is cached by Dynamic Page Cache.
$this->assertSession()->responseHeaderEquals(DynamicPageCacheSubscriber::HEADER, 'HIT');
$url = Url::fromRoute('entity.user.canonical', ['user' => 1]);
$this->drupalGet($url);
$this->drupalGet($url);
// Verify that user profile page is cached by Dynamic Page Cache.
$this->assertSession()->responseHeaderEquals(DynamicPageCacheSubscriber::HEADER, 'HIT');
// Make sure the editorial workflow is installed after enabling the
// content_moderation module.
\Drupal::service('module_installer')->install(['content_moderation']);
$role = Role::create([
'id' => 'admin_workflows',
'label' => 'Admin workflow',
]);
$role->grantPermission('administer workflows');
$role->save();
$this->adminUser->addRole($role->id())->save();
$this->rebuildContainer();
$this->drupalGet('admin/config/workflow/workflows/manage/editorial');
$this->assertSession()->pageTextContains('Draft');
$this->assertSession()->pageTextContains('Published');
$this->assertSession()->pageTextContains('Archived');
$this->assertSession()->pageTextContains('Create New Draft');
$this->assertSession()->pageTextContains('Publish');
$this->assertSession()->pageTextContains('Archive');
$this->assertSession()->pageTextContains('Restore to Draft');
$this->assertSession()->pageTextContains('Restore');
\Drupal::service('module_installer')->install(['media']);
$role = Role::create([
'id' => 'admin_media',
'label' => 'Admin media',
]);
$role->grantPermission('administer media');
$role->grantPermission('administer media display');
$role->save();
$this->adminUser->addRole($role->id())->save();
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
/** @var \Drupal\media\Entity\MediaType $media_type */
foreach (MediaType::loadMultiple() as $media_type) {
$media_type_machine_name = $media_type->id();
$this->drupalGet('media/add/' . $media_type_machine_name);
// Get the form element, and its HTML representation.
$form_selector = '#media-' . Html::cleanCssIdentifier($media_type_machine_name) . '-add-form';
$form = $assert_session->elementExists('css', $form_selector);
$form_html = $form->getOuterHtml();
// The name field should be hidden.
$assert_session->fieldNotExists('Name', $form);
// The source field should be shown before the vertical tabs.
$source_field_label = $media_type->getSource()->getSourceFieldDefinition($media_type)->getLabel();
$test_source_field = $assert_session->elementExists('xpath', "//*[contains(text(), '$source_field_label')]", $form)->getOuterHtml();
$vertical_tabs = $assert_session->elementExists('css', '.js-form-type-vertical-tabs', $form)->getOuterHtml();
$this->assertGreaterThan(strpos($form_html, $test_source_field), strpos($form_html, $vertical_tabs));
// The "Published" checkbox should be the last element.
$date_field = $assert_session->fieldExists('Date', $form)->getOuterHtml();
$published_checkbox = $assert_session->fieldExists('Published', $form)->getOuterHtml();
$this->assertGreaterThan(strpos($form_html, $date_field), strpos($form_html, $published_checkbox));
if (is_a($media_type->getSource(), Image::class, TRUE)) {
// Assert the default entity view display is configured with an image
// style.
$this->drupalGet('/admin/structure/media/manage/' . $media_type->id() . '/display');
$assert_session->fieldValueEquals('fields[field_media_image][type]', 'image');
$assert_session->elementTextContains('css', 'tr[data-drupal-selector="edit-fields-field-media-image"]', 'Image style: Large (480×480)');
// By default for media types with an image source, only the image
// component should be enabled.
$assert_session->elementsCount('css', 'input[name$="_settings_edit"]', 1);
}
}
// Tests that user 1 does not have an all-access pass.
$this->drupalLogin($this->rootUser);
$this->drupalGet('admin');
$this->assertSession()->statusCodeEquals(200);
User::load(1)
->removeRole('administrator')
->save();
// Clear caches so change take effect in system under test.
$this->rebuildAll();
$this->drupalGet('admin');
$this->assertSession()->statusCodeEquals(403);
}
/**
* Installs the responsive image module.
*/
protected function installResponsiveImage(): void {
// Install responsive_image module.
\Drupal::service('module_installer')->install(['responsive_image']);
$this->rebuildContainer();
}
}