Skip to content
Snippets Groups Projects

Draft: Issue #3442714: AJAX error when password field is hidden

1 file
+ 6
0
Compare changes
  • Side-by-side
  • Inline
+ 6
0
@@ -91,6 +91,12 @@ function password_policy_form_user_form_alter(&$form, FormStateInterface $form_s
@@ -91,6 +91,12 @@ function password_policy_form_user_form_alter(&$form, FormStateInterface $form_s
':input[name="pass[pass1]"]' => ['value' => ''],
':input[name="pass[pass1]"]' => ['value' => ''],
],
],
],
],
 
// If this element is hidden in the after build callback there is still
 
// an AJAX callback bound to the roles field that will renders this. This
 
// is a workaround to avoid an error being generated from this scenario.
 
// @todo Find a way to cleanly remove the AJAX callback on the roles.
 
// @see https://www.drupal.org/project/password_policy/issues/3442714
 
'#attached' => [],
];
];
// Set ajax changes.
// Set ajax changes.
Loading