diff -u b/core/lib/Drupal/Core/Config/ConfigImporter.php b/core/lib/Drupal/Core/Config/ConfigImporter.php --- b/core/lib/Drupal/Core/Config/ConfigImporter.php +++ b/core/lib/Drupal/Core/Config/ConfigImporter.php @@ -526,9 +526,7 @@ } $sync_steps[] = 'processConfigurations'; - $presync = $this->moduleHandler->invokeAll('config_import_presync_steps'); - $postsync = $this->moduleHandler->invokeAll('config_import_postsync_steps'); - $sync_steps = array_merge($presync, $sync_steps, $postsync); + // Allow modules to add new steps to configuration synchronization. $this->moduleHandler->alter('config_import_steps', $sync_steps); $sync_steps[] = 'finish'; return $sync_steps; diff -u b/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php --- b/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php @@ -198,11 +198,8 @@ $this->assertFalse(isset($GLOBALS['hook_config_test']['predelete'])); $this->assertFalse(isset($GLOBALS['hook_config_test']['delete'])); - // Verify that hook_config_import_presync_steps(), - // hook_config_import_postsync_steps(), hook_config_import_steps_alter() can - // add steps to configuration synchronization. - $this->assertTrue(isset($GLOBALS['hook_config_test']['config_import_presync_steps'])); - $this->assertTrue(isset($GLOBALS['hook_config_test']['config_import_postsync_steps'])); + // Verify that hook_config_import_steps_alter() can add steps to + // configuration synchronization. $this->assertTrue(isset($GLOBALS['hook_config_test']['config_import_steps_alter'])); // Verify that there is nothing more to import. diff -u b/core/modules/config/tests/config_import_test/config_import_test.module b/core/modules/config/tests/config_import_test/config_import_test.module --- b/core/modules/config/tests/config_import_test/config_import_test.module +++ b/core/modules/config/tests/config_import_test/config_import_test.module @@ -6,20 +6,6 @@ */ /** - * Implements hook_config_import_presync_steps(). - */ -function config_import_test_config_import_presync_steps() { - return array('_config_import_test_config_import_presync_step'); -} - -/** - * Implements hook_config_import_postsync_steps(). - */ -function config_import_test_config_import_postsync_steps() { - return array('_config_import_test_config_import_postsync_step'); -} - -/** * Implements hook_config_import_steps_alter(). */ function config_import_test_config_import_steps_alter(&$sync_steps) { @@ -27,30 +13,6 @@ } /** - * Implements pre configuration synchronization step for testing. - * - * @param array $context - * The batch context. - */ -function _config_import_test_config_import_presync_step(&$context) { - $GLOBALS['hook_config_test']['config_import_presync_steps'] = TRUE; - $context['finished'] = 1; - return; -} - -/** - * Implements post configuration synchronization step for testing. - * - * @param array $context - * The batch context. - */ -function _config_import_test_config_import_postsync_step(&$context) { - $GLOBALS['hook_config_test']['config_import_postsync_steps'] = TRUE; - $context['finished'] = 1; - return; -} - -/** * Implements configuration synchronization step added by an alter for testing. * * @param array $context diff -u b/core/modules/system/system.api.php b/core/modules/system/system.api.php --- b/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -2879,42 +2879,28 @@ } /** - * Adds pre steps to the configuration synchronization process. - * - * @return callable[] - * An array of callables that are invoked before the extensions and - * configuration are synchronized. - * - * @see \Drupal\Core\Config\ConfigImporter::initialize() - */ -function hook_config_import_presync_steps() { - return array('_custom_configuration_presync_step'); -} - -/** - * Adds post steps to the configuration synchronization process. - * - * @return callable[] - * An array of callables that are invoked after the extensions and - * configuration are synchronized. - * - * @see \Drupal\Core\Config\ConfigImporter::initialize() - */ -function hook_config_import_postsync_steps() { - return array('_custom_configuration_postsync_step'); -} - -/** * Alter the configuration synchronization steps. * * @param array $sync_steps - * An array of \Drupal\Core\Config\ConfigImporter method names and callables - * that are invoked to complete the import. + * 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 + * @link batch Batch operations @endlink documentation. * + * @see callback_batch_operation() * @see \Drupal\Core\Config\ConfigImporter::initialize() */ function hook_config_import_steps_alter(&$sync_steps) { - $sync_steps[] = '_custom_configuration_altered_step'; + $sync_steps[] = '_additional_configuration_step'; } /**