1 filter.module filter_config_data_validate(Config $config, array $config_info)

Implements hook_config_data_validate().

File

core/modules/filter/filter.module, line 235
Framework for handling the filtering of content.

Code

function filter_config_data_validate(Config $config, array $config_info) {
  if (strpos($config->getName(), 'filter.format.') === 0) {
    $filters = $config->get('filters');
    $all_filter_info = filter_get_filters();
    foreach ($filters as $filter_name => $filter) {
      if (isset($filter['module']) && !module_exists($filter['module'])) {
        throw new ConfigValidateException(t('The configuration "@file" could not be imported because the module "@module" that provides the filter "@filter" is not enabled.', array('@file' => $config->getName(), '@module' => $filter['module'], '@filter' => $filter_name)));
      }
      if (!isset($all_filter_info[$filter_name])) {
        throw new ConfigValidateException(t('The configuration "@file" could not be imported because the filter "@filter" is not recognized. Be sure that the module providing this filter is enabled.', array('@file' => $config->getName(), '@filter' => $filter_name)));
      }
    }
  }
}