diff -u b/core/includes/install.core.inc b/core/includes/install.core.inc --- b/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -463,9 +463,16 @@ if (!$install_state['interactive']) { $batch = $function($install_state); if (!empty($batch['operations'])) { + // Build a dummy 'context' array to avoid exceptions. + $batch_context = array( + 'sandbox' => &$current_set['sandbox'], + 'results' => &$current_set['results'], + 'finished' => &$finished, + 'message' => &$task_message, + ); foreach ($batch['operations'] as $operation) { list($function, $args) = $operation; - call_user_func_array($function, $args); + call_user_func_array($function, array_merge($args, array(&$batch_context))); } } return; diff -u b/core/modules/node/node.module b/core/modules/node/node.module --- b/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -3978,9 +3978,6 @@ */ function node_requirements($phase) { $requirements = array(); - if ($phase !== 'runtime') { - return $requirements; - } // Ensure translations don't break at install time $t = get_t(); // Only show rebuild button if there are either 0, or 2 or more, rows @@ -3991,6 +3988,9 @@ */ function node_requirements($phase) { $requirements = array(); + if ($phase !== 'runtime') { + return $requirements; + } // Ensure translations don't break at install time $t = get_t(); // Only show rebuild button if there are either 0, or 2 or more, rows diff -u b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php --- b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -580,7 +580,16 @@ protected function setUp() { global $user, $conf; $language_interface = drupal_container()->get(LANGUAGE_TYPE_INTERFACE); - + //Get old batch id and token + $batch = batch_get(); + if(!empty($batch['id'])) { + $this->batch_id = $batch['id']; + $this->old_token = drupal_get_token($this->batch_id); + } + else { + $this->batch_id = NULL; + $this->old_token = NULL; + } // Create the database prefix for this test. $this->prepareDatabasePrefix(); @@ -668,16 +677,16 @@ // the current user. drupal_get_token() returns a different value after // test execution, so the batch finished page does not load. // $session_id = session_id(); -// $originalSession = isset($_SESSION) ? $_SESSION : NULL; -// $originalGlobals = $GLOBALS; -// $request = request(); - + $originalSession = isset($_SESSION) ? $_SESSION : NULL; + $originalGlobals = $GLOBALS; + $request = request(); + install_drupal($settings); // session_id($session_id); -// $_SESSION = $originalSession; -// $GLOBALS = $originalGlobals; -// request($request); + $_SESSION = $originalSession; + $GLOBALS = $originalGlobals; + request($request); // Restore the original Simpletest batch. // $batch = &batch_get(); @@ -805,6 +814,16 @@ // Close the CURL handler. $this->curlClose(); + + if(!empty($this->batch_id)) { + //Regenerate batch token after install_drupal created a new session_id. + db_update('batch') + ->fields(array( + 'token' => drupal_get_token($this->batch_id), + )) + ->condition('token', $this->old_token) + ->execute(); + } } /** only in patch2: unchanged: --- a/core/includes/cache.inc +++ b/core/includes/cache.inc @@ -24,13 +24,12 @@ * @see Drupal\Core\Cache\CacheBackendInterface */ function cache($bin = 'cache') { + $cache_objects = &drupal_static(__FUNCTION__, array()); + // Temporary backwards compatibiltiy layer, allow old style prefixed cache // bin names to be passed as arguments. $bin = str_replace('cache_', '', $bin); - // We do not use drupal_static() here because we do not want to change the - // storage of a cache bin mid-request. - static $cache_objects; if (!isset($cache_objects[$bin])) { $cache_backends = cache_get_backends(); $class = isset($cache_backends[$bin]) ? $cache_backends[$bin] : $cache_backends['cache'];