Commit 05c20c77 authored by Gerhard Killesreiter's avatar Gerhard Killesreiter

#54002, Cached JS files break new drupal js error reporting behavior. Improved patch by chx

parent 599fae43
......@@ -1145,15 +1145,16 @@ function drupal_add_link($attributes) {
* it adds "misc/drupal.js" to the output. Other scripts
* depends on the 'killswitch' inside it.
*/
function drupal_add_js($file) {
function drupal_add_js($file, $nocache = FALSE) {
static $sent = array();
$postfix = $nocache ? '?'. time() : '';
if (!isset($sent['misc/drupal.js'])) {
drupal_set_html_head('<script type="text/javascript" src="'. base_path() .'misc/drupal.js"></script>');
drupal_set_html_head('<script type="text/javascript" src="'. base_path() .'misc/drupal.js'. $postfix .'"></script>');
$sent['misc/drupal.js'] = true;
}
if (!isset($sent[$file])) {
drupal_set_html_head('<script type="text/javascript" src="'. check_url(base_path() . $file) .'"></script>');
drupal_set_html_head('<script type="text/javascript" src="'. check_url(base_path() . $file) . $postfix .'"></script>');
$sent[$file] = true;
}
}
......
......@@ -353,8 +353,7 @@ function update_selection_page() {
drupal_set_title('Drupal database update');
// Prevent browser from using cached drupal.js or update.js
drupal_add_js('misc/update.js?'.time());
drupal_add_js('misc/drupal.js?'.time());
drupal_add_js('misc/update.js', TRUE);
$output .= drupal_get_form('update_script_selection_form', $form);
return $output;
......
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