You are here

function webform_update_8095 in Webform 6.x

Same name and namespace in other branches
  1. 8.5 includes/webform.install.update.inc \webform_update_8095()

Issue #2918721: Access controlling Webform administration.

1 call to webform_update_8095()
webform_update_8105 in includes/webform.install.update.inc
Issue #2941174 Notice: Undefined index: administer in WebformEntitySettingsAccessForm.

File

includes/webform.install.update.inc, line 1809
Archived Webform update hooks.

Code

function webform_update_8095() {
  $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();
    if (!isset($data['access']['administer'])) {
      $data['access']['administer'] = [
        'roles' => [],
        'users' => [],
        'permissions' => [],
      ];
      $webform_config
        ->setData($data)
        ->save();
    }
  }
}