Last modified: 2014-05-09 19:51:10 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T66522, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 64522 - Hovercards: TypeError: page.revisions is undefined on Preferences reset link
Hovercards: TypeError: page.revisions is undefined on Preferences reset link
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Popups (Other open bugs)
master
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.beta.wmflabs.org/...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-28 03:10 UTC by spage
Modified: 2014-05-09 19:51 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description spage 2014-04-28 03:10:31 UTC
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.
Comment 1 Prateek Saxena 2014-04-28 03:44:42 UTC
There are patches that fix this awaiting review:
https://gerrit.wikimedia.org/r/#/c/127889/
https://gerrit.wikimedia.org/r/#/c/129402/

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links