inline_image_saver-1.0.x-dev/inline_image_saver.install
inline_image_saver.install
<?php
/**
* @file
* Install, update and uninstall functions for the inline_image_saver module.
*/
declare(strict_types=1);
use Drupal\inline_image_saver\Form\InlineImageSaverSettingsForm;
/**
* Migrates old config keys to new names.
*/
function inline_image_saver_update_10200(): void {
$config = \Drupal::configFactory()->getEditable(InlineImageSaverSettingsForm::CONFIG_NAME);
$enable_validation = $config->get('validation');
$enable_download = $config->get('try_download');
\Drupal::service('config.installer')->installDefaultConfig('module', 'inline_image_saver');
$config
->set('enable_validation', $enable_validation)
->set('enable_download', $enable_download)
->save();
}
