Skip to content

Commit

Permalink
Update for Drupal 10
Browse files Browse the repository at this point in the history
  • Loading branch information
occupant committed Jan 3, 2024
1 parent f28ab4e commit cd88c7c
Show file tree
Hide file tree
Showing 20 changed files with 14 additions and 1,047 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "ubc-web-services/ubc_science_shared_config",
"description": "Custom UBC Drupal 9 config modules for the Science suite of websites",
"description": "Custom UBC Drupal 10 config modules for the Science suite of websites",
"type": "drupal-module",
"require": {
"ubc-web-services/ubc_d8_config_modules": "^5.0@beta"
"ubc-web-services/ubc_d8_config_modules": "^6.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ package: UBC Web Services
dependencies:
- ubc_announcement:ubc_announcement
- ubc_science_shared_config:ubc_science_shared_config
core_version_requirement: ^9 || ^10
core_version_requirement: ^10
Original file line number Diff line number Diff line change
Expand Up @@ -235,188 +235,3 @@ function ubc_science_announcement_extend_install() {
function ubc_science_announcement_extend_uninstall() {
}

/**
* Update 9001 - Update to form and view modes for announcement
*/

/* function ubc_science_announcement_extend_update_9001() {
$config = \Drupal::service('config.factory');
$config->getEditable('core.entity_form_display.node.ubc_announcement.default')
->clear(
'hidden.field_announcement_department',
'hidden.field_announcement_image_caption',
'hidden.field_announcement_industry',
'hidden.field_announcement_media_contact',
'hidden.field_announcement_topic',
)
->set('dependencies.module', [
'allowed_formats',
'field_group',
'focal_point',
'link',
'maxlength',
'metatag',
'path',
'scheduler',
'text',
])
->set('third_party_settings.field_group.group_feature_title_override.children', [
'field_announcement_type',
'field_announcement_department',
'field_announcement_industry',
'field_announcement_topic',
'field_announcement_media_contact',
'field_announcement_tags',
])
->set('content.body', [
'weight' => '3',
'type' => 'text_textarea_with_summary',
'region' => 'content',
'third_party_settings' => [
'maxlength' => [
'maxlength_js' => 'null',
'maxlength_js_label' => 'Content limited to @limit characters, remaining: <strong>@remaining</strong>',
'maxlength_js_summary' => '160',
'maxlength_js_label_summary' => 'Content limited to @limit characters, remaining: <strong>@remaining</strong>',
'maxlength_js_enforce' => 'true',
'maxlength_js_truncate_html' => 'false',
],
'allowed_formats' => [
'hide_help' => '0',
'hide_guidelines' => '0',
],
],
'settings' => [
'rows' => '9',
'placeholder' => '',
'summary_rows' => '3',
'show_summary' => 'true',
],
])
->set('content.field_announcement_type', [
'weight' => '4',
'type' => 'options_select',
'region' => 'content',
'settings' => [],
'third_party_settings' => [],
])
->set('content.field_announcement_department', [
'weight' => '5',
'type' => 'options_select',
'region' => 'content',
'settings' => [],
'third_party_settings' => [],
])
->set('content.field_announcement_industry', [
'weight' => '6',
'type' => 'options_select',
'region' => 'content',
'settings' => [],
'third_party_settings' => [],
])
->set('content.field_announcement_topic', [
'weight' => '7',
'type' => 'options_select',
'region' => 'content',
'settings' => [],
'third_party_settings' => [],
])
->set('content.field_announcement_media_contact', [
'weight' => '8',
'type' => 'options_select',
'region' => 'content',
'settings' => [],
'third_party_settings' => [],
])
->set('content.field_announcement_external_link', [
'weight' => '3',
'type' => 'link_default',
'region' => 'content',
'third_party_settings' => [
'maxlength' => [
'maxlength_js' => '100',
'maxlength_js_label' => 'Content limited to @limit characters, remaining: <strong>@remaining</strong>',
],
],
'settings' => [
'placeholder_url' => '',
'placeholder_title' => '',
],
])
->set('content.field_announcement_image_caption', [
'weight' => '2',
'type' => 'string_textfield',
'region' => 'content',
'third_party_settings' => [
'maxlength' => [
'maxlength_js' => '150',
'maxlength_js_label' => 'Content limited to @limit characters, remaining: <strong>@remaining</strong>',
],
],
'settings' => [
'size' => '60',
'placeholder' => 'Add a caption to the feature image if applicable.',
],
])
->save();
$config->getEditable('field.field.node.ubc_announcement.field_announcement_feature_image')
->set('description', 'Add a feature image to the announcement. Feature image must be at least 980x653.')
->set('settings.file_extensions', 'png jpg jpeg')
->set('settings.max_resolution', '')
->set('settings.min_resolution', '980x653')
->save();
$config->getEditable('core.entity_view_display.node.ubc_announcement.featured_content')
->set('dependencies.config', [
'core.entity_view_mode.node.featured_content',
'field.field.node.ubc_announcement.body',
'field.field.node.ubc_announcement.field_announcement_department',
'field.field.node.ubc_announcement.field_announcement_external_link',
'field.field.node.ubc_announcement.field_announcement_feature_image',
'field.field.node.ubc_announcement.field_announcement_image_caption',
'field.field.node.ubc_announcement.field_announcement_industry',
'field.field.node.ubc_announcement.field_announcement_media_contact',
'field.field.node.ubc_announcement.field_announcement_meta_tags',
'field.field.node.ubc_announcement.field_announcement_tags',
'field.field.node.ubc_announcement.field_announcement_topic',
'field.field.node.ubc_announcement.field_announcement_type',
'node.type.ubc_announcement',
'responsive_image.styles.masthead_focal_point',
])
->set('content.field_announcement_feature_image.settings.responsive_image_style', 'masthead_focal_point')
->set('content.field_announcement_image_caption', [
'weight' => '1',
'type' => 'string',
'region' => 'content',
'label' => 'hidden',
'third_party_settings' => [],
'settings' => [
'link_to_entity' => false,
],
])
->save();
} */

/**
* Update 9002 - Update to display mode for announcement
*/
/* function ubc_science_announcement_extend_update_9002() {
$config = \Drupal::service('config.factory');
$config->getEditable('core.entity_view_display.node.ubc_announcement.featured_content')
->set('dependencies.config', [
'core.entity_view_mode.node.featured_content',
'field.field.node.ubc_announcement.body',
'field.field.node.ubc_announcement.field_announcement_department',
'field.field.node.ubc_announcement.field_announcement_external_link',
'field.field.node.ubc_announcement.field_announcement_feature_image',
'field.field.node.ubc_announcement.field_announcement_image_caption',
'field.field.node.ubc_announcement.field_announcement_industry',
'field.field.node.ubc_announcement.field_announcement_media_contact',
'field.field.node.ubc_announcement.field_announcement_meta_tags',
'field.field.node.ubc_announcement.field_announcement_tags',
'field.field.node.ubc_announcement.field_announcement_topic',
'field.field.node.ubc_announcement.field_announcement_type',
'node.type.ubc_announcement',
'responsive_image.styles.masthead_focal_point',
])
->save();
} */
2 changes: 1 addition & 1 deletion ubc_science_blog/ubc_science_blog.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ package: UBC Web Services
dependencies:
- drupal:simple_sitemap
- ubc_science_shared_config:ubc_science_shared_config
core_version_requirement: ^9 || ^10
core_version_requirement: ^10
2 changes: 1 addition & 1 deletion ubc_science_event_extend/ubc_science_event_extend.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ package: UBC Web Services
dependencies:
- ubc_event:ubc_event
- ubc_science_shared_config:ubc_science_shared_config
core_version_requirement: ^9 || ^10
core_version_requirement: ^10
2 changes: 1 addition & 1 deletion ubc_science_guide/ubc_science_guide.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ dependencies:
- drupal:paragraphs
- drupal:simple_sitemap
- ubc_science_shared_config:ubc_science_shared_config
core_version_requirement: ^9 || ^10
core_version_requirement: ^10
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ package: UBC Web Services
dependencies:
- ubc_homepage:ubc_homepage
- ubc_science_shared_config:ubc_science_shared_config
core_version_requirement: ^9 || ^10
core_version_requirement: ^10
12 changes: 0 additions & 12 deletions ubc_science_homepage_extend/ubc_science_homepage_extend.install
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,3 @@ function ubc_science_homepage_extend_install() {
function ubc_science_homepage_extend_uninstall() {
}
*/

/**
* Update 9001 - update feature image extentions
*/
/* function ubc_science_homepage_extend_update_9001() {
$config = \Drupal::service('config.factory');
$config->getEditable('field.field.node.homepage.field_home_feature_image')
->set('settings.file_extensions', 'png jpg jpeg')
->save();
}

*/
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ dependencies:
- ubc_landing_page:ubc_landing_page
- ubc_landing_page_views:ubc_landing_page_views
- ubc_science_shared_config:ubc_science_shared_config
core_version_requirement: ^9 || ^10
core_version_requirement: ^10
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,3 @@ function ubc_science_landing_page_extend_install() {
*/
function ubc_science_landing_page_extend_uninstall() {
}

/**
* Update 9001 - update feature image extensions
*/

/* function ubc_science_landing_page_extend_update_9001() {
$config = \Drupal::service('config.factory');
$config->getEditable('field.field.node.ubc_landing_page.field_landing_feature_image')
->set('settings.file_extensions', 'png jpg jpeg')
->save();
}
*/
2 changes: 1 addition & 1 deletion ubc_science_nodes/ubc_science_nodes.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ name: UBC Science Nodes
type: module
description: This module alters the node add and edit forms to add some custom markup to improve the editorial experience.
package: UBC Web Services
core_version_requirement: ^9 || ^10
core_version_requirement: ^10
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ dependencies:
- drupal:conditional_fields
- ubc_profile:ubc_profile
- ubc_science_shared_config:ubc_science_shared_config
core_version_requirement: ^9 || ^10
core_version_requirement: ^10
Loading

0 comments on commit cd88c7c

Please sign in to comment.