Page MenuHomePhabricator

VisualEditor's "Page options" dialog throws an exception if the page has more categories than the API tells us about
Closed, ResolvedPublic1 Story Points

Description

"Page options" dialog throws exceptions if the page has any hidden categories. For example, try on https://en.wikipedia.beta.wmflabs.org/wiki/Albert_Einstein?veaction=edit.

When the dialog is opened for the first time, it acts as if the page had no categories. When it is opened for the second time, only the dialog's overlay appears – it can't be closed, and the user can't save or recover the edit and loses all their input.

Uncaught TypeError: Cannot read property 'hidden' of undefined
    at Object.<anonymous> (https://en.wikipedia.beta.wmflabs.org/w/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWCategoryWidget.js?fb93e:352:30)
    at Object.<anonymous> (https://en.wikipedia.beta.wmflabs.org/w/load.php?debug=true&lang=en&modules…mediawiki.legacy.wikibits&only=scripts&skin=vector&version=0r0nkm9:3305:33)
    at fire (https://en.wikipedia.beta.wmflabs.org/w/load.php?debug=true&lang=en&modules…mediawiki.legacy.wikibits&only=scripts&skin=vector&version=0r0nkm9:3148:30)
    at Object.fireWith [as resolveWith] (https://en.wikipedia.beta.wmflabs.org/w/load.php?debug=true&lang=en&modules…Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=0r0nkm9:3260:7)
    at Object.<anonymous> (https://en.wikipedia.beta.wmflabs.org/w/load.php?debug=true&lang=en&modules…mediawiki.legacy.wikibits&only=scripts&skin=vector&version=0r0nkm9:3312:41)
    at fire (https://en.wikipedia.beta.wmflabs.org/w/load.php?debug=true&lang=en&modules…mediawiki.legacy.wikibits&only=scripts&skin=vector&version=0r0nkm9:3148:30)
    at Object.fireWith [as resolveWith] (https://en.wikipedia.beta.wmflabs.org/w/load.php?debug=true&lang=en&modules…Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=0r0nkm9:3260:7)
    at Object.deferred.(anonymous function) [as resolve] (https://en.wikipedia.beta.wmflabs.org/w/load.php?debug=true&lang=en&modules…mediawiki.legacy.wikibits&only=scripts&skin=vector&version=0r0nkm9:3350:34)
    at Object.<anonymous> (https://en.wikipedia.beta.wmflabs.org/w/resources/src/mediawiki/api.js?f05d6:275:19)
    at fire (https://en.wikipedia.beta.wmflabs.org/w/load.php?debug=true&lang=en&modules…mediawiki.legacy.wikibits&only=scripts&skin=vector&version=0r0nkm9:3148:30)

Event Timeline

Restricted Application added a project: VisualEditor. · View Herald TranscriptApr 20 2017, 12:30 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Jdforrester-WMF triaged this task as High priority.Apr 20 2017, 12:49 AM
Jdforrester-WMF set the point value for this task to 1.
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.
DLynch claimed this task.Apr 20 2017, 9:31 PM
DLynch added a subscriber: DLynch.

In the Albert Einstein case, this isn't anything to do with hidden categories. Rather, it's failing because the pageprops API call it's making will only tell you about up to 50 categories at once, and the code doesn't expect to not receive a response about every category.

Jdforrester-WMF renamed this task from VisualEditor's "Page options" dialog throws exceptions if the page has any hidden categories to VisualEditor's "Page options" dialog throws an exception if the page has more categories than the API tells us about.Apr 20 2017, 9:36 PM

Change 349338 had a related patch set uploaded (by DLynch):
[mediawiki/extensions/VisualEditor@master] MWCategoryWidget: batch requests for category data

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

Change 349338 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] MWCategoryWidget: batch requests for category data

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

Jdforrester-WMF closed this task as Resolved.Apr 25 2017, 6:35 PM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

'ere's for 'opin'.

Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptApr 25 2017, 6:35 PM