function webform_update_8109 in Webform 6.x
Same name and namespace in other branches
- 8.5 includes/webform.install.update.inc \webform_update_8109()
Issue #2933909: Webform Image Select Element Improvements.
File
- includes/
webform.install.update.inc, line 2023 - Archived Webform update hooks.
Code
function webform_update_8109() {
$config_factory = \Drupal::configFactory();
$install_webform_image_select = FALSE;
foreach ($config_factory
->listAll('webform.webform.') as $webform_config_name) {
$webform_config = $config_factory
->get($webform_config_name);
$elements = $webform_config
->get('elements');
if (strpos($elements, 'webform_image_select') !== FALSE) {
$install_webform_image_select = TRUE;
break;
}
}
if ($install_webform_image_select && !\Drupal::moduleHandler()
->moduleExists('webform_image_select')) {
\Drupal::service('module_installer')
->install([
'webform_image_select',
]);
}
}