From a0152d5ccf2ef26ec6421d2dfff62babb5569778 Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole Date: Fri, 3 Jan 2014 17:22:34 +0000 Subject: [PATCH] Issue #2160589 by vijaycs85: Remove drupal_add_js() from theme.inc. --- core/includes/theme.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 3db84a97b19..8596de853d2 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -237,9 +237,15 @@ function _drupal_theme_initialize($theme, $base_theme = array()) { } // Add scripts used by this theme. + $js = array(); foreach ($final_scripts as $script) { - drupal_add_js($script, array('group' => JS_THEME, 'every_page' => TRUE)); + $js['#attached']['js'][] = array( + 'data' => $script, + 'group' => JS_THEME, + 'every_page' => TRUE, + ); } + drupal_render($js); $theme_engine = NULL;