Page MenuHomePhabricator

AJAX "Show changes" doesn't work when creating a page: "TypeError: response[0].query.pages[0].revisions is undefined"
Open, Needs TriagePublic

Description

Browsers tested: Firefox and Chrome.
Wikis tested: Wikipedia (en, sv); Wiktionary (en, sv)

Steps to reproduce:

  1. Go to Preferences > Editing , ensure that "Show previews without reloading the page" is checked
  2. Go to edit the source of a non-existing page, e.g. https://en.wikipedia.org/w/index.php?title=asdffdsa&action=edit&debug=true
  3. Enter a few words into the main textbox
  4. Click the button "Show changes"

Expected results:

  • The diff is shown above

Actual results:

  • The spinner is briefly shown, and a warning is logged to the console (see below)

Error in the console:

TypeError: response[0].query.pages[0].revisions is undefined
Stack trace:
doLivePreview/<@https://en.wikipedia.org/w/resources/src/mediawiki.action/mediawiki.action.edit.preview.js?6f153:110:1
jQuery.Callbacks/fire@https://en.wikipedia.org/w/load.php?debug=true&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=0le4p6m:3148:10
jQuery.Callbacks/self.fireWith@https://en.wikipedia.org/w/load.php?debug=true&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=0le4p6m:3260:7
.when/updateFunc/<@https://en.wikipedia.org/w/load.php?debug=true&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=0le4p6m:3389:7
jQuery.Callbacks/fire@https://en.wikipedia.org/w/load.php?debug=true&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=0le4p6m:3148:10
jQuery.Callbacks/self.fireWith@https://en.wikipedia.org/w/load.php?debug=true&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=0le4p6m:3260:7
.Deferred/</deferred[tuple[0]]@https://en.wikipedia.org/w/load.php?debug=true&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=0le4p6m:3350:5
mw.Api.prototype.ajax/xhr<@https://en.wikipedia.org/w/resources/src/mediawiki/api.js?f05d6:275:7
jQuery.Callbacks/fire@https://en.wikipedia.org/w/load.php?debug=true&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=0le4p6m:3148:10
jQuery.Callbacks/self.fireWith@https://en.wikipedia.org/w/load.php?debug=true&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=0le4p6m:3260:7
done@https://en.wikipedia.org/w/load.php?debug=true&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=0le4p6m:9314:5
.send/callback@https://en.wikipedia.org/w/load.php?debug=true&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=0le4p6m:9718:8