Error message

You are browsing documentation for drupal 7.x, which is not supported anymore. Read the updated version of this page for drupal 11.x (the latest version).

function hook_batch_alter

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Form/form.api.php \hook_batch_alter()
  2. 10 core/lib/Drupal/Core/Form/form.api.php \hook_batch_alter()
  3. 9 core/lib/Drupal/Core/Form/form.api.php \hook_batch_alter()
  4. 8.9.x core/lib/Drupal/Core/Form/form.api.php \hook_batch_alter()

Alter batch information before a batch is processed.

Called by batch_process() to allow modules to alter a batch before it is processed.

Parameters

$batch: The associative array of batch information. See batch_set() for details on what this could contain.

See also

batch_set()

batch_process()

Related topics

Batch operations
Creates and processes batch operations.
Hooks
Allow modules to interact with the Drupal core.
1 function implements hook_batch_alter()

Note: the procedural functions in this list are found by pattern matching, so the list may include some functions that are not actually implementations of this hook.

overlay_batch_alter in modules/overlay/overlay.module
Implements hook_batch_alter().
1 invocation of hook_batch_alter()
batch_process in includes/form.inc
Processes the batch.

File

modules/system/system.api.php, line 4646

Code

function hook_batch_alter (&$batch) {
 // If the current page request is inside the overlay, add ?render=overlay to
 // the success callback URL, so that it appears correctly within the overlay.
 if (overlay_get_mode () == 'child') {
 if (isset($batch['url_options']['query'])) {
 $batch['url_options']['query']['render'] = 'overlay';
 }
 else {
 $batch['url_options']['query'] = array(
 'render' => 'overlay',
 );
 }
 }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.