From f32dad672278b11f3a1096ec1720e1c6badfbafe Mon Sep 17 00:00:00 2001 From: Elliott Foster Date: Wed, 22 Feb 2012 09:53:04 -0600 Subject: [PATCH] #9 by @deviantintegral and @pwolanin --- includes/common.inc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/includes/common.inc b/includes/common.inc index a969a311d3d..3d46f4f7bd5 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -2218,6 +2218,15 @@ function drupal_add_js($data = NULL, $type = 'module', $scope = 'header', $defer ), 'inline' => array(), ); + // We never cache authenticated user pages, so if they are logged in we + // allow setting of the has_js cookie so batch API functions use the JS + // version. + // user_is_anonymous() is not used here because it is unavailable during + // installation. + // @see user_is_anonymous() + if (!empty($GLOBALS['user']->uid) || isset($GLOBALS['menu_admin'])) { + $javascript['footer']['inline'][] = array('code' => "document.cookie = 'has_js=1; path=/';", 'defer' => TRUE); + } } if (isset($scope) && !isset($javascript[$scope])) {