Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
[OPENY-237] Changed update config to openy_upgrade_tool.param_updater
Browse files Browse the repository at this point in the history
  • Loading branch information
Miroslav Lee committed Dec 19, 2018
1 parent c1fdfac commit 88a86ff
Showing 1 changed file with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,19 +260,20 @@ function openy_media_image_update_8009() {
* Remove blazy for icons.
*/
function openy_media_image_update_8010() {
\Drupal::configFactory()
->getEditable('core.entity_view_display.media.image.icon')
->set('dependencies.module', ['image'])
->set('content.field_media_image', [
'weight' => 0,
'label' => 'hidden',
'settings' => [
'image_style' => '',
'image_link' => '',
],
'third_party_settings' => [],
'type' => 'image',
'region' => 'content',
])
->save();
$config_dir = drupal_get_path('module', 'openy_media_image') . '/config/install/';
// Update multiple configurations.
$configs = [
'core.entity_view_display.media.image.icon' => [
'dependencies.module',
'content.field_media_image',
],
];

$config_updater = \Drupal::service('openy_upgrade_tool.param_updater');
foreach ($configs as $config_name => $params) {
$config = $config_dir . $config_name . '.yml';
foreach ($params as $param) {
$config_updater->update($config, $config_name, $param);
}
}
}

0 comments on commit 88a86ff

Please # to comment.