Skip to content
Snippets Groups Projects
Commit 2bdd02a0 authored by Rajab Natshah's avatar Rajab Natshah
Browse files

Issue #2915114: Update entity form display for media image type, to use the...

Issue #2915114: Update entity form display for media image type, to use the latest config after we Updated [Focal Point] module from 8.1.0-beta4 to 8.1.0-beta5
parent ee2c22d9
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ dependencies: ...@@ -6,7 +6,7 @@ dependencies:
- image.style.field_preview - image.style.field_preview
- media_entity.bundle.image - media_entity.bundle.image
module: module:
- image - focal_point
- path - path
id: media.image.default id: media.image.default
targetEntityType: media targetEntityType: media
...@@ -18,13 +18,16 @@ content: ...@@ -18,13 +18,16 @@ content:
settings: settings:
preview_image_style: field_preview preview_image_style: field_preview
progress_indicator: throbber progress_indicator: throbber
preview_link: true
offsets: '50,50'
third_party_settings: { } third_party_settings: { }
type: image_image type: image_focal_point
region: content region: content
langcode: langcode:
type: language_select type: language_select
weight: 2 weight: 2
settings: { } settings:
include_locked: true
third_party_settings: { } third_party_settings: { }
region: content region: content
name: name:
......
...@@ -112,3 +112,52 @@ function varbase_media_update_8008() { ...@@ -112,3 +112,52 @@ function varbase_media_update_8008() {
} }
} }
/**
* Added social large, medium, and small image styles.
*/
function varbase_media_update_8009() {
$config_path = \Drupal::root() . '/' . drupal_get_path('module', 'varbase_media') . '/config/install/';
$config_names = [
'image.style.social_large',
'image.style.social_medium',
'image.style.social_small'
];
foreach ($config_names as $config_name) {
$config_file = $config_path . $config_name . '.yml';
if (file_exists($config_file)) {
$config = \Drupal::service('config.factory')->getEditable($config_name);
$config_content = file_get_contents($config_file);
$config_content_data = (array) Yaml::parse($config_content);
$config->setData($config_content_data)->save();
}
}
}
/**
* Update entity form display for media image type, to use the latest config
* from the focal point module.
*/
function varbase_media_update_8010() {
$config_path = \Drupal::root() . '/' . drupal_get_path('module', 'varbase_media') . '/config/install/';
$config_names = [
'core.entity_form_display.media.image.default'
];
foreach ($config_names as $config_name) {
$config_file = $config_path . $config_name . '.yml';
if (file_exists($config_file)) {
$config = \Drupal::service('config.factory')->getEditable($config_name);
$config_content = file_get_contents($config_file);
$config_content_data = (array) Yaml::parse($config_content);
$config->setData($config_content_data)->save();
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment