Page MenuHomePhabricator

jQuery.Deferred exception: languageTag is null
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Open any template for editing in the wikitext editor.

What happens?:

The following error is shown in the browser's console:

jQuery.Deferred exception: languageTag is null 
bcp47@
Dialog.js/Dialog.prototype.updateParamDetailsLanguage@
Dialog.js/Dialog.prototype.createParamDetails@
Dialog.js/Dialog.prototype.initialize@
OO.ui.Window.prototype.setManager@

What should have happened instead?:

The button for opening the TemplateData dialog should be shown above the editing form.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

  • Browser: Firefox 117

Event Timeline

Presumably introduced by @thiemowmde in this patch for T238329. It added the call to mw.language.bcp47 (which errors if the language passed is null), when before it'd have just resulted in us setting the lang attr to empty.

I think this.language == null is a valid state -- it looks like it's supposed to be a filter that's only set after the language dropdown has been used, and is null otherwise.

Change 960628 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/TemplateData@master] In Dialog don't error if this.language is null

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

Oh man. This might the 4th time I'm touching this particular code for something that seemed so simple. I'm really sorry.

No, null is not valid. It's only temporary as long as the dialog is not fully initialized. What my patch https://gerrit.wikimedia.org/r/959793 did was uncovering another, much older bug. Fixed in https://gerrit.wikimedia.org/r/960630. Needs backporting, I believe.

Change 960628 abandoned by DLynch:

[mediawiki/extensions/TemplateData@master] In Dialog don't error if this.language is null

Reason:

Fixed by I47c8ce16107ebe7a1d955665dc890bef80ec892a instead

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

I don't think we need a backport -- your patch merged on the 21st, and today's branch won't be cut for a few hours yet. So long as we get a fix merged promptly this will never have made it to a production server.

DLynch reassigned this task from DLynch to thiemowmde.

Thiemo's https://gerrit.wikimedia.org/r/960630 is merged (I was waiting for the notification on here, but I just realized it's not tagged against this ticket).