This error happens when the javascript is included, but the role of the user changing the password has no password policy.
Our caching configuration made this happen.
The result is the cursor jumps frantically from the second password box to the first one.
We just include a small check that prevents this.
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | password_policy-add_missing_js_dependency-1937336-18.patch | 480 bytes | aohrvetpv |
| #17 | password_policy-add_missing_js_dependency-1937336-17.patch | 456 bytes | aohrvetpv |
| #14 | e3ceb728400d25ee33c0f7f6c469f420.png | 53.84 KB | spheresh |
| #9 | 1937336-drupalSetSummary.patch | 456 bytes | spheresh |
| summary_error.patch | 1.32 KB | batje |
Comments
Comment #1
erikwebb commentedsummary_error.patch queued for re-testing.
Comment #3
StevenWill commentedI am also experiencing the same cursor jumping frantically from the second password box to the first one. This happens without caching and although the patch stopped the error it did not resolve the issue of the cursor jumping to the first password box.
Comment #4
caspervoogt commentednot experiencing the cursors issue (did experience it before, but I believe that got patched by another patch). I do however have this error. So maybe the cursor issue and this error are unrelated.
Based on some other posts about JS messages about drupalSetSummary thought maybe I had to increase PHP's max_input_vars and max_input_nesting, but that didn't help either. I think I have ruled that out as a possible cause. I also tested with and without JS aggregation.
I noticed that drupalSetSummary is defined by /misc/form.js but that JS file is not loaded on the /user page. So naturally it can't find this function. I added a JS include to my theme's html.tpl.php, but then /misc/form.js complained that jQuery was not defined, even though it is ... I am using it throughout the site and the /user page does include the jQuery JS file too.
Comment #5
StevenWill commentedYes, the cursor issue was resolved for me with the dev branch.
Comment #6
aohrvetpv commentedIs there a reliable way to reproduce the error? Where do you see it?
I am unable to reproduce it. From a fresh Drupal installation:
1. Created user 'foo'.
2. Created roles 'bar' and 'baz'.
3. Assigned user 'foo' to role 'bar'.
4. Created password policy, applied to role 'baz'.
5. Logged in as user 'foo'.
6. Changed password via 'My account' page without any such error occurring.
Comment #7
aohrvetpv commentedNeed information per previous comment.
Comment #8
aohrvetpv commentedA month has passed with no information on how to reproduce this. Please re-open if you still have this issue.
Comment #9
spheresh commentedI have a same problem.
My patch works fine for me
Comment #10
spheresh commentedComment #11
aohrvetpv commentedspheresh: Thanks for the patch. How can the problem be reproduced so I can try it out? Also, which browser are you using?
Comment #12
spheresh commentedHi, AohRveTPV.
I use Chrome, but is sure that it is not dependent on the browser version.
I display the user registration form using the panel, and perhaps the problem lies somewhere deep in the core of Drupal or Ctools.
I do not know the reason why the form.js file is not connected, but in any case, the patch will not be redundant.
Comment #13
aohrvetpv commentedWhat is the panel and how do you put the user registration form there? (Is this functionality provided by the Panels module?)
It would be very helpful if you provided steps of how to reproduce this problem from a fresh Drupal 7 site.
It is not clear to me why including forms.js would be necessary, and whether that will even fully fix the problem. Committing some code that fixes the problem for some users for reasons unknown would be programming by coincidence. A way to reliably re-create this problem is very much needed.
Comment #14
spheresh commentedUnfortunately I do not have much time to describe the problem, but I will make a screen, it will be clear to users

so I deduce the registration form, as this is vital for my project
I believe that we need to connect the form.js file, as password_policy.js uses drupalSetSummary function from it.
and module password_policy should care about connecting all libraries.
Comment #15
aohrvetpv commentedThanks, spheresh. I am now able to reproduce the
drupalSetSummary()problem. The original bug report also mentions the cursor "jump[ing] frantically from the second password box to the first one". I did not observe any problem with the cursor. Do you observe this cursor behavior?Comment #16
aohrvetpv commentedSteps to reproduce:
In the Firefox Web Console, the following error is observed:
TypeError: $(...).drupalSetSummary is not a functionComment #17
aohrvetpv commentedPatch in #9 seems to be the right solution.
The module was relying on the
drupal.formlibrary being incidentally loaded by other elements on the user edit page, etc. to providedrupalSetSummary(). For instance, if there was a collapsible fieldset for timezone selection on the user edit page,drupal.formwould be loaded.Versus #9 I have moved the
drupal_add_library()call to what I think it is a more logical place inpassword_policy_password_element_alter(): adjacent to the attachment ofpassword_policy.js. Hopefully this has no functional effect.Besides
password_policy_password_element_alter(),PasswordPolicy::admin()also loadspassword_policy.js. However, it does so in vertical tabs, which I think will causedrupal.formto incidentally be loaded. It might be an improvement to explicitly loaddrupal.formthere even though it is not needed.I wonder if it might be a better approach to define a library for
password_policy.jsand listdrupal.formas a dependency so it is implicitly loaded.password_policy.jsdoes not really provide a library for other modules to use though, so this may not be appropriate.Comment #18
aohrvetpv commentedSeems more consistent to load the library using
#attachedas withpassword_policy.js. Please comment if this approach is disadvantageous for some reason.Comment #19
spheresh commentedLooks good, I'll try this patch in my project, soon. Thanks.
Comment #20
aohrvetpv commented