You are here

function _webform_config_update in Webform 8.5

Same name and namespace in other branches
  1. 6.x includes/webform.editor.inc \_webform_config_update()

Update config editor file references.

Parameters

\Drupal\Core\Config\Config $config: An editable configuration object.

1 call to _webform_config_update()
WebformAdminConfigBaseForm::submitForm in src/Form/AdminConfig/WebformAdminConfigBaseForm.php
Form submission handler.

File

includes/webform.editor.inc, line 76
Webform module editor file upload hooks.

Code

function _webform_config_update(Config $config) {
  $original_uuids = _webform_get_array_file_uuids($config
    ->getOriginal());
  $uuids = _webform_get_array_file_uuids($config
    ->getRawData());

  // Detect file usages that should be incremented.
  $added_files = array_diff($uuids, $original_uuids);
  _webform_record_file_usage($added_files, 'config', $config
    ->getName());

  // Detect file usages that should be decremented.
  $removed_files = array_diff($original_uuids, $uuids);
  _webform_delete_file_usage($removed_files, 'config', $config
    ->getName(), 1);
}