You are here

function _webform_config_schema_info_alter_settings_recursive in Webform 6.x

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

Convert most data types to 'string' to support tokens.

Parameters

array $settings: An associative array of schema settings.

Return value

array An associative array of schema settings with most data types to 'string' to support tokens

1 call to _webform_config_schema_info_alter_settings_recursive()
webform_config_schema_info_alter in ./webform.module
Implements hook_config_schema_info_alter().

File

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

Code

function _webform_config_schema_info_alter_settings_recursive(array $settings) {
  foreach ($settings as $name => $setting) {
    if (is_array($setting)) {
      $settings[$name] = _webform_config_schema_info_alter_settings_recursive($setting);
    }
    elseif ($name === 'type' && in_array($setting, [
      'boolean',
      'integer',
      'float',
      'uri',
      'email',
    ])) {
      $settings[$name] = 'string';
    }
  }
  return $settings;
}