Page MenuHomePhabricator

JavaScript error in Chrome, preferences don't save
Closed, ResolvedPublic5 Estimated Story Points

Description

On Chrome, MacOS High Sierra, I see the following the JS console:

Uncaught Error: No infusion data found: undefined
    at Object.OO.ui.Element.static.unsafeInfuse (load.php?debug=false&lang=en&modules=oojs-ui-core%2Coojs-ui-widgets&skin=vector&version=0us3uht:8)
    at Object.OO.ui.Element.static.infuse (load.php?debug=false&lang=en&modules=oojs-ui-core%2Coojs-ui-widgets&skin=vector&version=0us3uht:7)
    at Object.OO.ui.infuse (load.php?debug=false&lang=en&modules=oojs-ui-core%2Coojs-ui-widgets&skin=vector&version=0us3uht:3)
    at HTMLTextAreaElement.<anonymous> (<anonymous>:78:16)
    at Function.each (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=vector&version=1nv7gwr:4)
    at jQuery.fn.init.each (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=vector&version=1nv7gwr:2)
    at HTMLInputElement.onChangeGlobalCheckboxes (<anonymous>:77:8912)
    at HTMLInputElement.dispatch (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=vector&version=1nv7gwr:69)
    at HTMLInputElement.elemData.handle (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=vector&version=1nv7gwr:66)
    at Object.trigger (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=vector&version=1nv7gwr:112)
    at HTMLInputElement.<anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=vector&version=1nv7gwr:113)
    at Function.each (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=vector&version=1nv7gwr:4)
    at jQuery.fn.init.each (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=vector&version=1nv7gwr:2)
    at jQuery.fn.init.trigger (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=vector&version=1nv7gwr:113)
    at jQuery.fn.init.jQuery.fn.(anonymous function) [as change] (https://test.wikipedia.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=1nv7gwr:113:763)
    at HTMLDocument.<anonymous> (<anonymous>:79:327)
    at mightThrow (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=vector&version=1nv7gwr:49)
    at process (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=vector&version=1nv7gwr:50)

The form looks OK, and appears to be usable, and the JS for "Select options below to be global" still works, etc., but changes to my preferences don't save.

After saving a preference in Firefox, however, I'm able to come back to Chrome and everything works as expected (but I still see the above JS error in the console). If in Firefox I uncheck "Select options below to be global" for all tabs, save, then go back to Chrome, again changes to preferences don't save.

Event Timeline

Niharika set the point value for this task to 5.Mar 28 2018, 11:37 PM
TBolliger removed the point value for this task.
TBolliger set the point value for this task to 5.

I haven't been able to replicate this.

Do you have any odd extensions loaded that are using OOUI widgets?

Could you have a look what specific element is causing this? Find all elements with .oo-ui-inputWidget-input and then look at their parents with .oo-ui-widget and they should all be valid OOUI widgets (MultiselectWidget etc.) but perhaps they're not.

We were seeing this same problem on https://test.wikipedia.org/wiki/Special:GlobalPreferences during the latest test deployment. Seems to be a incompatibility with one of the extensions there (one using a OOUI widget that we haven't considered maybe?).

Change 429125 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[mediawiki/extensions/GlobalPreferences@master] Select only named inputs for adding the global checkboxes to

https://gerrit.wikimedia.org/r/429125

Change 429125 merged by jenkins-bot:
[mediawiki/extensions/GlobalPreferences@master] Select only named inputs for adding the global checkboxes to

https://gerrit.wikimedia.org/r/429125

Samwilson moved this task from Ready to Needs Review/Feedback on the Community-Tech-Sprint board.

@MusikAnimal can you have another test of this? Should be okay now (he says, hopefully not jinxing it).

Change 429132 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[mediawiki/extensions/GlobalPreferences@master] Add dependency on UsersMultiselectWidget

https://gerrit.wikimedia.org/r/429132

Sorry about the multiple patches for this, it seems there was some other stuff going on with Chrome and how it handles $.parents(). The latest patch https://gerrit.wikimedia.org/r/#/c/429132/ is deployed on CommTech wiki now, if you could have a play?

"No such special page", did we accidentally disable it?

Change 429132 merged by jenkins-bot:
[mediawiki/extensions/GlobalPreferences@master] Add dependency on UsersMultiselectWidget

https://gerrit.wikimedia.org/r/429132

Hm, yup it was turned off. I've turned it on again.

(By the way, you were having some issue getting it installed locally weren't you? Do we need to look into that more?)

Looks good on my end!! The checkboxes for the beta features are now disabled until I tick "Select options below to be global", which I take it is the intended behaviour.

By the way, you were having some issue getting it installed locally weren't you? Do we need to look into that more?

I need to at least try again, yes :)

Samwilson moved this task from Needs Review/Feedback to Q1 2018-19 on the Community-Tech-Sprint board.

Cool! That's good.

And ping me anytime about local installation woes. Would love to make it as easy as possible.