Commit 9771f15f authored by Dries's avatar Dries
Browse files

- Patch #179143 by Gabor, JirkaRybka, chx, ChrisKennedy, et al: do not fire...

- Patch #179143 by Gabor, JirkaRybka, chx, ChrisKennedy, et al: do not fire bootstrap hooks during update.
parent db2c726a
......@@ -294,6 +294,8 @@ function drupal_get_destination() {
* @see drupal_get_destination()
*/
function drupal_goto($path = '', $query = NULL, $fragment = NULL, $http_response_code = 302) {
global $update_mode;
if (isset($_REQUEST['destination'])) {
extract(parse_url(urldecode($_REQUEST['destination'])));
}
......@@ -306,7 +308,10 @@ function drupal_goto($path = '', $query = NULL, $fragment = NULL, $http_response
$url = str_replace(array("\n", "\r"), '', $url);
// Allow modules to react to the end of the page request before redirecting.
module_invoke_all('exit', $url);
// We do not want this while running update.php.
if (empty($update_mode)) {
module_invoke_all('exit', $url);
}
// Even though session_write_close() is registered as a shutdown function, we
// need all session data written to the database before redirecting.
......@@ -1853,7 +1858,7 @@ function drupal_add_js($data = NULL, $type = 'module', $scope = 'header', $defer
* References to JavaScript files are placed in a certain order: first, all
* 'core' files, then all 'module' and finally all 'theme' JavaScript files
* are added to the page. Then, all settings are output, followed by 'inline'
* JavaScript code.
* JavaScript code. If running update.php, all preprocessing is disabled.
*
* @parameter $scope
* (optional) The scope for which the JavaScript rules should be returned.
......@@ -1865,7 +1870,8 @@ function drupal_add_js($data = NULL, $type = 'module', $scope = 'header', $defer
* All JavaScript code segments and includes for the scope as HTML tags.
*/
function drupal_get_js($scope = 'header', $javascript = NULL) {
if (function_exists('locale_inc_callback')) {
global $update_mode;
if (empty($update_mode) && function_exists('locale_inc_callback')) {
locale_inc_callback('_locale_update_js_files');
}
......@@ -1881,7 +1887,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL) {
$preprocessed = '';
$no_preprocess = array('core' => '', 'module' => '', 'theme' => '');
$files = array();
$preprocess_js = variable_get('preprocess_js', FALSE);
$preprocess_js = (variable_get('preprocess_js', FALSE) && empty($update_mode));
$directory = file_directory_path();
$is_writable = is_dir($directory) && is_writable($directory) && (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC);
......@@ -2459,6 +2465,7 @@ function xmlrpc($url) {
function _drupal_bootstrap_full() {
static $called;
global $update_mode;
if ($called) {
return;
......@@ -2485,8 +2492,10 @@ function _drupal_bootstrap_full() {
// Load all enabled modules
module_load_all();
// Let all modules take action before menu system handles the request
module_invoke_all('init');
// We do not want this while running update.php.
if (empty($update_mode)) {
module_invoke_all('init');
}
}
/**
......
......@@ -813,6 +813,11 @@ function update_task_list($active = NULL) {
include_once './includes/bootstrap.inc';
update_fix_system_table();
// Bootstrap Drupal in a safe way, without calling hook_init() and hook_exit(),
// to avoid possible warnings. We need to set the global variable after
// DRUPAL_BOOTSTRAP_CONFIGURATION, which unsets globals, but before the rest.
drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
$update_mode = TRUE;
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
drupal_maintenance_theme();
......
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