Page MenuHomePhabricator

TemplateWizard is failing to fetch certain templates even when they have TemplateData
Closed, ResolvedPublic

Description

Discovered this for the template "שחקן נבחרת" in Hebrew Wiki: https://he.wikipedia.org/w/index.php?title=תבנית:שחקן_נבחרת

If asking the API directly, the TemplateData exists and returns valid information: https://he.wikipedia.org/w/api.php?action=templatedata&format=json&generator=prefixsearch&gpssearch=%D7%A9%D7%97%D7%A7%D7%9F%20%D7%A0%D7%91%D7%97%D7%A8%D7%AA&gpsnamespace=10&redirects=true&includeMissingTitles=true&lang=he
(The above was copy/pasted from the request made by TemplateWizard through teh console, so the request itself seems to be structured properly)

However, when using the TemplateWizard dialog itself on Hebrew Wiki, searching for "שחקן נבחרת" and clicking that result, the dialog shows no fields and no description. The "Network" tab shows a request in red -- unresolved properly.

I disabled PrivacyBadger and Adblocker, so it seems like a different error, but I can't pinpoint what that might be.

Event Timeline

Mooeypoo created this task.Oct 22 2018, 7:54 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 22 2018, 7:54 PM

Update: When using Firefox, the network tab DOES show a response, but the dialog still shows the entire template as if TemplateData doesnt' exist.

Query params:

action	templatedata
format	json
generator	prefixsearch
gpsnamespace	10
gpssearch	שחקן נבחרת
includeMissingTitles	true
lang	he
redirects	true

Response payload:

{"batchcomplete":"","pages":{"205230":{"title":"\u05ea\u05d1\u05e0\u05d9\u05ea:\u05e9\u05d7\u05e7\u05df \u05e0\u05d1\u05d7\u05e8\u05ea","params":{"\u05de\u05e1":{"label":null,"required":false,"suggested":false,"description":null,"example":null,"deprecated":false,"aliases":[],"autovalue":null,"default":null,"type":"unknown"},"\u05e2\u05de\u05d3\u05d4":{"label":null,"required":false,"suggested":false,"description":null,"example":null,"deprecated":false,"aliases":[],"autovalue":null,"default":null,"type":"unknown"},"\u05e9\u05dd":{"label":null,"required":false,"suggested":false,"description":null,"example":null,"deprecated":false,"aliases":[],"autovalue":null,"default":null,"type":"unknown"},"\u05d0\u05d7\u05e8":{"label":null,"required":false,"suggested":false,"description":null,"example":null,"deprecated":false,"aliases":[],"autovalue":null,"default":null,"type":"unknown"},"\u05ea\u05d0\u05e8\u05d9\u05da \u05dc\u05d9\u05d3\u05d4":{"label":null,"required":false,"suggested":false,"description":null,"example":null,"deprecated":false,"aliases":[],"autovalue":null,"default":null,"type":"unknown"},"\u05d4\u05d5\u05e4\u05e2\u05d5\u05ea":{"label":null,"required":false,"suggested":false,"description":null,"example":null,"deprecated":false,"aliases":[],"autovalue":null,"default":null,"type":"unknown"},"\u05e9\u05e2\u05e8\u05d9\u05dd":{"label":null,"required":false,"suggested":false,"description":null,"example":null,"deprecated":false,"aliases":[],"autovalue":null,"default":null,"type":"unknown"},"\u05d0\u05e8\u05e5":{"label":null,"required":false,"suggested":false,"description":null,"example":null,"deprecated":false,"aliases":[],"autovalue":null,"default":null,"type":"unknown"},"\u05de\u05d5\u05e2\u05d3\u05d5\u05df":{"label":null,"required":false,"suggested":false,"description":null,"example":null,"deprecated":false,"aliases":[],"autovalue":null,"default":null,"type":"unknown"},"\u05d0\u05d7\u05e8 \u05de\u05d5\u05e2\u05d3\u05d5\u05df":{"label":null,"required":false,"suggested":false,"description":null,"example":null,"deprecated":false,"aliases":[],"autovalue":null,"default":null,"type":"unknown"}},"format":"inline","description":null,"paramOrder":["\u05de\u05e1","\u05e2\u05de\u05d3\u05d4","\u05e9\u05dd","\u05d0\u05d7\u05e8","\u05ea\u05d0\u05e8\u05d9\u05da \u05dc\u05d9\u05d3\u05d4","\u05d4\u05d5\u05e4\u05e2\u05d5\u05ea","\u05e9\u05e2\u05e8\u05d9\u05dd","\u05d0\u05e8\u05e5","\u05de\u05d5\u05e2\u05d3\u05d5\u05df","\u05d0\u05d7\u05e8 \u05de\u05d5\u05e2\u05d3\u05d5\u05df"],"sets":[],"maps":{}},"205229":{"title":"\u05ea\u05d1\u05e0\u05d9\u05ea:\u05e9\u05d7\u05e7\u05df \u05e0\u05d1\u05d7\u05e8\u05ea \u05d4\u05ea\u05d7\u05dc\u05d4","params":{"\u05de\u05e1\u05e4\u05e8":{"label":null,"required":false,"suggested":false,"description":null,"example":null,"deprecated":false,"aliases":[],"autovalue":null,"default":null,"type":"unknown"},"\u05d4\u05d5\u05e4\u05e2\u05d5\u05ea \u05d5\u05e9\u05e2\u05e8\u05d9\u05dd":{"label":null,"required":false,"suggested":false,"description":null,"example":null,"deprecated":false,"aliases":[],"autovalue":null,"default":null,"type":"unknown"}},"format":"inline","description":null,"paramOrder":["\u05de\u05e1\u05e4\u05e8","\u05d4\u05d5\u05e4\u05e2\u05d5\u05ea \u05d5\u05e9\u05e2\u05e8\u05d9\u05dd"],"sets":[],"maps":{}},"205231":{"title":"\u05ea\u05d1\u05e0\u05d9\u05ea:\u05e9\u05d7\u05e7\u05df \u05e0\u05d1\u05d7\u05e8\u05ea \u05e1\u05d5\u05e3","notemplatedata":"","params":[]},"1191291":{"title":"\u05ea\u05d1\u05e0\u05d9\u05ea:\u05e9\u05d7\u05e7\u05df \u05e0\u05d1\u05d7\u05e8\u05ea \u05e8\u05d5\u05d5\u05d7","notemplatedata":"","params":[]}}}

TemplateWizard empty screen:

The link in TemplateWizard correctly leads to the correct template https://he.wikipedia.org/wiki/%D7%AA%D7%91%D7%A0%D7%99%D7%AA:%D7%A9%D7%97%D7%A7%D7%9F_%D7%A0%D7%91%D7%97%D7%A8%D7%AA

It seems to work when adding safemode=1. There seems to be a problem with a gadget (default one probably) that interferes with the parsing into the dialog. @eranroz can you help? I'm having trouble figuring out which one.

I tried to copy it to a local installation and couldn't reproduce the issue.
Looking further into the DOM, this is actually due to CSS class name clash - namelly "parameters" class being used for local gadget and adds additonal settings in Common.css.

To avoid it we should change:
$( '<div>' ).addClass( 'parameters' )
to
$( '<div>' ).addClass( 'ext-templatewizard-parameters' )

Change 469156 had a related patch set uploaded (by Bartosz Dziewoński; owner: Eranroz):
[mediawiki/extensions/TemplateWizard@master] Unique names for classes

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

Change 469156 merged by jenkins-bot:
[mediawiki/extensions/TemplateWizard@master] Unique names for classes

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

Niharika closed this task as Resolved.Nov 15 2018, 11:08 PM
Niharika moved this task from QA to Q2 2018-19 on the Community-Tech-Sprint board.
Niharika claimed this task.