Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291122

user_form_process_password_confirm() doesn't properly detect duplicate js settings

$
0
0

I have a custom form that uses password_confirm element. During validation step, $form_state['rebuild'] is set, and so, the form is re-processed. When this element is re-processed, however, the settings are not added because of this part:

<?php
 
static $already_added = FALSE;
  if (!
$already_added) {
   
$already_added = TRUE;
   
$element['#attached']['js'][] = array('data'=> $js_settings, 'type'=> 'setting');
  }
?>

As this funcion is being called a second time in the same request, the settings don't get added, which causes a JS error. I'll work on a patch to fix this.


Viewing all articles
Browse latest Browse all 291122

Trending Articles