Same name and namespace in other branches
  1. 8.9.x core/core.api.php \hook_config_import_steps_alter()
  2. 9 core/core.api.php \hook_config_import_steps_alter()

Alter the configuration synchronization steps.

Parameters

array $sync_steps: A one-dimensional array of \Drupal\Core\Config\ConfigImporter method names or callables that are invoked to complete the import, in the order that they will be processed. Each callable item defined in $sync_steps should either be a global function or a public static method. The callable should accept a $context array by reference. For example:

function _additional_configuration_step(&$context) {

  // Do stuff.
  // If finished set $context['finished'] = 1.
}

For more information on creating batches, see the Batch operations documentation.

See also

callback_batch_operation()

\Drupal\Core\Config\ConfigImporter::initialize()

Related topics

2 functions implement hook_config_import_steps_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

config_import_test_config_import_steps_alter in core/modules/config/tests/config_import_test/config_import_test.module
Implements hook_config_import_steps_alter().
field_config_import_steps_alter in core/modules/field/field.module
Implements hook_config_import_steps_alter().
1 invocation of hook_config_import_steps_alter()
ConfigImporter::initialize in core/lib/Drupal/Core/Config/ConfigImporter.php
Initializes the config importer in preparation for processing a batch.

File

core/core.api.php, line 2256
Documentation landing page and topics, plus core library hooks.

Code

function hook_config_import_steps_alter(&$sync_steps, \Drupal\Core\Config\ConfigImporter $config_importer) {
  $deletes = $config_importer
    ->getUnprocessedConfiguration('delete');
  if (isset($deletes['field.storage.node.body'])) {
    $sync_steps[] = '_additional_configuration_step';
  }
}