You are here

function webform_config_schema_info_alter in Webform 6.x

Same name and namespace in other branches
  1. 8.5 webform.module \webform_config_schema_info_alter()

Implements hook_config_schema_info_alter().

File

./webform.module, line 127
Enables the creation of webforms and questionnaires.

Code

function webform_config_schema_info_alter(&$definitions) {
  if (empty($definitions['webform.webform.*']['mapping'])) {
    return;
  }
  $mapping = $definitions['webform.webform.*']['mapping'];

  // Copy setting, elements, and handlers to variant override schema.
  if (isset($definitions['webform.variant.override'])) {
    $definitions['webform.variant.override']['mapping'] += [
      'settings' => $mapping['settings'],
      'elements' => $mapping['elements'],
      'handlers' => $mapping['handlers'],
    ];
  }

  // Append settings handler settings schema.
  if (isset($definitions['webform.handler.settings'])) {
    $definitions['webform.handler.settings']['mapping'] += _webform_config_schema_info_alter_settings_recursive($mapping['settings']['mapping']);
  }
}