Skip to content

Commit

Permalink
Merge pull request #85 from vamsiymca/vkomarthi/DS-1549
Browse files Browse the repository at this point in the history
ds-1549:fix for responsive image issue on ios device.
  • Loading branch information
podarok authored Aug 1, 2024
2 parents 62d3237 + 16c8d94 commit 3c10395
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ content:
image_style: media_full
thumbnail_style: ''
media_switch: ''
ratio: enforced
sizes: ''
breakpoints:
xs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ content:
image_style: media_half
thumbnail_style: ''
media_switch: ''
ratio: enforced
sizes: ''
breakpoints:
xs:
Expand Down
23 changes: 23 additions & 0 deletions openy_media/modules/openy_media_image/openy_media_image.install
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,26 @@ function openy_media_image_update_8016() {
function openy_media_image_update_9001() {
EmbedButtonIconHelper::setEmbedButtonIcon('openy_media_image', 'image.svg', 'embed_image');
}

/**
* Update hook for media full and half settings.
*/
function openy_media_image_update_10001() {
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_media_image') . '/config/install/';

// List of configurations to update.
$configs = [
'core.entity_view_display.media.image.embedded_full',
'core.entity_view_display.media.image.embedded_half',
];

foreach ($configs as $config_name) {
$config = \Drupal::configFactory()->getEditable($config_name);

if ($config->get('content.field_media_image.settings.ratio') === 'enforced') {
$config->clear('content.field_media_image.settings.ratio')
->save();
}
}
}

0 comments on commit 3c10395

Please sign in to comment.