Handle a response object returned from Batch API in the installer.

8.0.x
Larry Garfield 2012-04-15 13:36:07 -05:00
parent a94bb607ed
commit e20de25cbe
1 changed files with 5 additions and 1 deletions

View File

@ -4,6 +4,7 @@ use Drupal\Core\Database\Database;
use Drupal\Core\Database\Install\TaskException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* @file
@ -498,10 +499,13 @@ function install_run_task($task, &$install_state) {
elseif ($current_batch == $function) {
include_once DRUPAL_ROOT . '/core/includes/batch.inc';
$output = _batch_page();
if ($output instanceof Response) {
$output->send();
}
// The task is complete when we try to access the batch page and receive
// FALSE in return, since this means we are at a URL where we are no
// longer requesting a batch ID.
if ($output === FALSE) {
elseif ($output === FALSE) {
// Return nothing so the next task will run in the same request.
variable_del('install_current_batch');
return;