Complete Batch API workaround for install system.
parent
e20de25cbe
commit
71146f2397
|
@ -499,13 +499,19 @@ function install_run_task($task, &$install_state) {
|
||||||
elseif ($current_batch == $function) {
|
elseif ($current_batch == $function) {
|
||||||
include_once DRUPAL_ROOT . '/core/includes/batch.inc';
|
include_once DRUPAL_ROOT . '/core/includes/batch.inc';
|
||||||
$output = _batch_page();
|
$output = _batch_page();
|
||||||
|
// Because Batch API now returns a JSON response for intermediary steps,
|
||||||
|
// but the installer doesn't handle Response objects yet, we will just
|
||||||
|
// send the output here and emulate the old model.
|
||||||
|
// @todo: Replace this when we refactor the installer to use a
|
||||||
|
// Request/Response workflow.
|
||||||
if ($output instanceof Response) {
|
if ($output instanceof Response) {
|
||||||
$output->send();
|
$output->send();
|
||||||
|
$output = NULL;
|
||||||
}
|
}
|
||||||
// The task is complete when we try to access the batch page and receive
|
// 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
|
// FALSE in return, since this means we are at a URL where we are no
|
||||||
// longer requesting a batch ID.
|
// longer requesting a batch ID.
|
||||||
elseif ($output === FALSE) {
|
if ($output === FALSE) {
|
||||||
// Return nothing so the next task will run in the same request.
|
// Return nothing so the next task will run in the same request.
|
||||||
variable_del('install_current_batch');
|
variable_del('install_current_batch');
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue