W3cubDocs

/Drupal 8

function 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 2188
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';
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!core.api.php/function/hook_config_import_steps_alter/8.1.x