Page MenuHomePhabricator

$wgDebugToolbar = true breaks ApiOpenSearch, and by proxy the suggestions bar on most pages
Closed, ResolvedPublic

Description

The suggestions API returns a plain javascript list, rather than an object like most things. The results are accessed as result[2] and such. Enabling the $wgDebugToolbar adds the debug data as the first entry in the list, shifting all the ApiOpenSearch results away from the expected index.

Event Timeline

EBernhardson raised the priority of this task from to Needs Triage.
EBernhardson updated the task description. (Show Details)
EBernhardson added a subscriber: EBernhardson.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 28 2015, 9:52 AM
EBernhardson set Security to None.

Example:

1With $wgDebugToolbar = false;
2
3["Te",["Test page link 1","Test page link 10","Test page link 11","Test page link 12","Test page link 13","Test page link 14","Test page link 15","Test page link 16","Test page link 17","Test page link 18"],["","","","","","","","","",""],["http://mediawiki-git.localwiki.com/wiki/Test_page_link_1","http://mediawiki-git.localwiki.com/wiki/Test_page_link_10","http://mediawiki-git.localwiki.com/wiki/Test_page_link_11","http://mediawiki-git.localwiki.com/wiki/Test_page_link_12","http://mediawiki-git.localwiki.com/wiki/Test_page_link_13","http://mediawiki-git.localwiki.com/wiki/Test_page_link_14","http://mediawiki-git.localwiki.com/wiki/Test_page_link_15","http://mediawiki-git.localwiki.com/wiki/Test_page_link_16","http://mediawiki-git.localwiki.com/wiki/Test_page_link_17","http://mediawiki-git.localwiki.com/wiki/Test_page_link_18"]]
4
5With $wgDebugToolbar = true; (pretty-printed)
6
7[
8 {
9 "mwVersion": "1.26alpha",
10 "phpEngine": "PHP",
11 "phpVersion": "5.6.1",
12 "gitRevision": "aab8487351dcf4f063e5db6a51bf5a7dc360ad60",
13 "gitBranch": "T78053",
14 "time": 0.090883016586304,
15 "log": [
16 {
17 "msg": "MWDebug output complete",
18 "type": "log",
19 "caller": "MWDebug::appendDebugInfoToApiResult"
20 }
21 ],
22 "debugLog": [
23 ],
24 "queries": [
25 ],
26 "request": {
27 "method": "GET",
28 "url": "\/api.php?action=opensearch&search=Te",
29 "headers": {
30 "HOST": "mediawiki-git.localwiki.com",
31 "USER-AGENT": "Mozilla\/5.0 (X11; Linux x86_64; rv:38.0) Gecko\/20100101 Firefox\/38.0",
32 "ACCEPT": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8",
33 "ACCEPT-LANGUAGE": "es-ES,es;q=0.8,en-US;q=0.6,en;q=0.4,ca;q=0.2",
34 "ACCEPT-ENCODING": "gzip, deflate",
35 "REFERER": "http:\/\/mediawiki-git.localwiki.com\/api.php?action=help&modules=opensearch",
36 "COOKIE": "mwgitUserName=Jesus; mwgitUserID=1",
37 "CONNECTION": "keep-alive",
38 "CACHE-CONTROL": "max-age=0"
39 },
40 "params": {
41 "action": "opensearch",
42 "search": "Te"
43 }
44 },
45 "memory": "10,95 MB",
46 "memoryPeak": "11,41 MB",
47 "includes": [
48 ]
49 },
50 "Te",
51 [
52 "Test page link 1",
53 "Test page link 10",
54 "Test page link 11",
55 "Test page link 12",
56 "Test page link 13",
57 "Test page link 14",
58 "Test page link 15",
59 "Test page link 16",
60 "Test page link 17",
61 "Test page link 18"
62 ],
63 [
64 "",
65 "",
66 "",
67 "",
68 "",
69 "",
70 "",
71 "",
72 "",
73 ""
74 ],
75 [
76 "http:\/\/mediawiki-git.localwiki.com\/wiki\/Test_page_link_1",
77 "http:\/\/mediawiki-git.localwiki.com\/wiki\/Test_page_link_10",
78 "http:\/\/mediawiki-git.localwiki.com\/wiki\/Test_page_link_11",
79 "http:\/\/mediawiki-git.localwiki.com\/wiki\/Test_page_link_12",
80 "http:\/\/mediawiki-git.localwiki.com\/wiki\/Test_page_link_13",
81 "http:\/\/mediawiki-git.localwiki.com\/wiki\/Test_page_link_14",
82 "http:\/\/mediawiki-git.localwiki.com\/wiki\/Test_page_link_15",
83 "http:\/\/mediawiki-git.localwiki.com\/wiki\/Test_page_link_16",
84 "http:\/\/mediawiki-git.localwiki.com\/wiki\/Test_page_link_17",
85 "http:\/\/mediawiki-git.localwiki.com\/wiki\/Test_page_link_18"
86 ]
87]
88

Change 214347 had a related patch set uploaded (by Anomie):
ApiOpenSearch: Ignore any other unexpected keys in json output

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

Umherirrender closed this task as Resolved.May 29 2015, 8:29 PM
Umherirrender claimed this task.
Anomie claimed this task.May 29 2015, 8:36 PM

Change 214347 merged by jenkins-bot:
ApiOpenSearch: Ignore any other unexpected keys in json output

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

Change 216311 had a related patch set uploaded (by Anomie):
ApiOpenSearch: Ignore any other unexpected keys in json output

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

Change 216311 merged by jenkins-bot:
ApiOpenSearch: Ignore any other unexpected keys in json output

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