You are here

function _webform_update_webform_settings in Webform 8.5

Same name and namespace in other branches
  1. 6.x includes/webform.install.inc \_webform_update_webform_settings()

Update webform settings to reflect changes in the default settings.

This function can be used to apply new webform settings to all existing webforms.

See also

\Drupal\webform\Entity\Webform::setSettings

59 calls to _webform_update_webform_settings()
WebformAdminConfigAdvancedForm::submitForm in src/Form/AdminConfig/WebformAdminConfigAdvancedForm.php
Form submission handler.
WebformCliService::drush_webform_repair in src/Commands/WebformCliService.php
webform_update_8008 in includes/webform.install.update.inc
Issue #2839615: Disabling message about viewing user's previous submissions.
webform_update_8009 in includes/webform.install.update.inc
Issue #2844020: Add admin and form specific setting to allow submit button to be clicked only once.
webform_update_8010 in includes/webform.install.update.inc
Issue #2843400: Automated purging of submissions.

... See full list

File

includes/webform.install.inc, line 82
Webform install helper functions.

Code

function _webform_update_webform_settings() {
  $config_factory = \Drupal::configFactory();
  foreach ($config_factory
    ->listAll('webform.webform.') as $webform_config_name) {
    $webform_config = $config_factory
      ->getEditable($webform_config_name);
    $data = $webform_config
      ->getRawData();
    $data = _webform_update_webform_setting($data);
    $webform_config
      ->setData($data)
      ->save();
  }
}