Skip to content

Commit f32dad6

Browse files
committed
1 parent fc46cb9 commit f32dad6

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

includes/common.inc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,6 +2218,15 @@ function drupal_add_js($data = NULL, $type = 'module', $scope = 'header', $defer
22182218
),
22192219
'inline' => array(),
22202220
);
2221+
// We never cache authenticated user pages, so if they are logged in we
2222+
// allow setting of the has_js cookie so batch API functions use the JS
2223+
// version.
2224+
// user_is_anonymous() is not used here because it is unavailable during
2225+
// installation.
2226+
// @see user_is_anonymous()
2227+
if (!empty($GLOBALS['user']->uid) || isset($GLOBALS['menu_admin'])) {
2228+
$javascript['footer']['inline'][] = array('code' => "document.cookie = 'has_js=1; path=/';", 'defer' => TRUE);
2229+
}
22212230
}
22222231

22232232
if (isset($scope) && !isset($javascript[$scope])) {

0 commit comments

Comments
 (0)