summaryrefslogtreecommitdiff
path: root/modules/user/user.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/user/user.module')
-rw-r--r--modules/user/user.module7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/user/user.module b/modules/user/user.module
index c07aa1461..3b3c6b2b4 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -3361,7 +3361,12 @@ function user_form_process_password_confirm($element) {
);
$element['#attached']['js'][] = drupal_get_path('module', 'user') . '/user.js';
- $element['#attached']['js'][] = array('data' => $js_settings, 'type' => 'setting');
+ // Ensure settings are only added once per page.
+ static $already_added = FALSE;
+ if (!$already_added) {
+ $already_added = TRUE;
+ $element['#attached']['js'][] = array('data' => $js_settings, 'type' => 'setting');
+ }
return $element;
}