Commit d8f91382 authored by webchick's avatar webchick

#539022 by dropcube: Use current theme during Batch API processes.

parent a667251e
...@@ -2890,6 +2890,8 @@ function batch_set($batch_definition) { ...@@ -2890,6 +2890,8 @@ function batch_set($batch_definition) {
function batch_process($redirect = NULL, $url = NULL) { function batch_process($redirect = NULL, $url = NULL) {
$batch =& batch_get(); $batch =& batch_get();
drupal_theme_initialize();
if (isset($batch)) { if (isset($batch)) {
// Add process information // Add process information
$url = isset($url) ? $url : 'batch'; $url = isset($url) ? $url : 'batch';
...@@ -2899,6 +2901,7 @@ function batch_process($redirect = NULL, $url = NULL) { ...@@ -2899,6 +2901,7 @@ function batch_process($redirect = NULL, $url = NULL) {
'url' => isset($url) ? $url : 'batch', 'url' => isset($url) ? $url : 'batch',
'source_page' => $_GET['q'], 'source_page' => $_GET['q'],
'redirect' => $redirect, 'redirect' => $redirect,
'theme' => $GLOBALS['theme_key'],
); );
$batch += $process_info; $batch += $process_info;
......
...@@ -1928,6 +1928,11 @@ function system_php() { ...@@ -1928,6 +1928,11 @@ function system_php() {
function system_batch_page() { function system_batch_page() {
require_once DRUPAL_ROOT . '/includes/batch.inc'; require_once DRUPAL_ROOT . '/includes/batch.inc';
$output = _batch_page(); $output = _batch_page();
// Use the same theme that the page that started the batch.
$batch = &batch_get();
$GLOBALS['custom_theme'] = $batch['theme'];
if ($output === FALSE) { if ($output === FALSE) {
drupal_access_denied(); drupal_access_denied();
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment