https://bugzilla.wikimedia.org/show_bug.cgi?id=64522
Bug ID: 64522
Summary: Hovercards: TypeError: page.revisions is undefined on
Preferences reset link
Product: MediaWiki extensions
Version: master
Hardware: All
URL: http://en.wikipedia.beta.wmflabs.org/wiki/Special:Pref
erences?debug=1
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: Popups
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Web browser: ---
Mobile Platform: ---
On en beta, visit preferences and then hover over the link _Restore all default
settings (in all sections)_
JS console reports an error
TypeError: page.revisions is undefined
it's coming from line 98 in ext.popups.core.js in curRequest.done
timestamp = new Date( page.revisions[ 0 ].timestamp ),
the API request I think it's handling is
http://en.wikipedia.beta.wmflabs.org/w/api.php?action=query&format=json&prop=extracts|pageimages|revisions|info&redirects=true&exintro=true&exsentences=2&explaintext=true&piprop=thumbnail&pithumbsize=300&rvprop=timestamp&inprop=watched&indexpageids=true&titles=Special%3APreferences%2Freset
which returns only
{"query":{\
"pageids":["-1"],
"pages":{"-1":{"ns":-1,"title":"Special:Preferences/reset","special":""}}}
}
1. There's no page.revisions for a Special page, so error. Test before
accessing nested keys.
2. It seems the code should give up before this anyway, since page.extract and
page.thumbnail are both undefined. That would avoid showing empty popups with a
timestamp.
3. This gets through the popup link tests around line 516 because the link is
to /wiki/Special:Preferences/reset, so no "#" or "?. There are other special
page links that would pass this. Maybe the code should test if the namespace of
the page is -1.
--
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l