hook_config_import_steps_alter

hook_config_import_steps_alter(&$sync_steps, \Drupal\Core\Config\ConfigImporter $config_importer)

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: <code> function _additional_configuration_step(&$context) { // Do stuff. // If finished set $context['finished'] = 1. } </code> For more information on creating batches, see the Batch operations documentation.

See also

callback_batch_operation()

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

Related topics

Hooks
Define functions that alter the behavior of Drupal core.

File

core/core.api.php, line 2203
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';
  }
}
doc_Drupal
2016-10-29 09:17:52
Comments
Leave a Comment

Please login to continue.