function webform_update_8030 in Webform 8.5
Same name and namespace in other branches
- 6.x includes/webform.install.update.inc \webform_update_8030()
Issue #2838423: Drafts for anonymous users.
File
- includes/
webform.install.update.inc, line 633 - Archived Webform update hooks.
Code
function webform_update_8030() {
$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['settings']['draft'] = $data['settings']['draft'] === TRUE ? WebformInterface::DRAFT_AUTHENTICATED : WebformInterface::DRAFT_NONE;
$webform_config
->setData($data)
->save();
}
}