Page MenuHomePhabricator

[wmf.20-regression] MinervaNeue - "Uncaught TypeError: Cannot convert undefined or null to object" when search for Special page
Closed, ResolvedPublic3 Estimated Story Points

Description

Switch to MinervaNeue skin and enter "Special:" in the Search box. The suggestion list is displayed and the selection can be made.
However, the following Console error will be displayed:

Uncaught TypeError: Cannot convert undefined or null to object
    at hasOwnProperty (<anonymous>)
    at addBinding (<anonymous>:239:1)
    at Watchstar.oo.EventEmitter.on (<anonymous>:239:212)
    at HTMLLIElement.<anonymous> (<anonymous>:576:167)
    at Function.each (https://en.wikipedia.beta.wmflabs.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=minerva&version=14kbqyi:4:939)
    at jQuery.fn.init.each (https://en.wikipedia.beta.wmflabs.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=minerva&version=14kbqyi:2:505)
    at <anonymous>:575:2391
    at fire (https://en.wikipedia.beta.wmflabs.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=minerva&version=14kbqyi:46:617)
    at Object.fireWith [as resolveWith] (https://en.wikipedia.beta.wmflabs.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=minerva&version=14kbqyi:47:824)
    at Object.deferred.(anonymous function) [as resolve] (https://en.wikipedia.beta.wmflabs.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=minerva&version=14kbqyi:51:337)

Developer notes

The error shows when searching for "Special:Nearby".
We only allow the watching of pages which have an id and all special pages by design have no pageid.

So before firing off the watchlist query we should filter out any results which do not have an id.

Acceptance criteria

  • Watchstar does not show up next to special pages
  • If all search results are special pages no request to the watch API is made
  • Pages without ids are not sent to the watch api.

@pmiazga: Not possible to verify without hacking as the watchstar is not present for Special:Articles. Because there is no element to trigger the watchAPI request there is no possibility to send page without id. I call it done

Testing criteria

  • Can be tested on beta cluster on the mobile website

Event Timeline

Etonkovidova renamed this task from [wmf.20-regression] MinervaNeue - "Uncaught TypeError: Cannot convert undefined or null to object" when search for Special to [wmf.20-regression] MinervaNeue - "Uncaught TypeError: Cannot convert undefined or null to object" when search for Special page.Feb 9 2018, 9:55 PM

Are we sure this is a regression and this worked in wmf.9? The code hasn't changed in a long time so this surprises me!

Jdlrobson updated the task description. (Show Details)

I've reopend this based on new information. Added developer notes and should be ready for estimation.

noting another bug:

  1. as a logged in user, search for any special page, example special:nearby
  2. select star to add special page to watchlist
  3. search for any other special page

Observed: all special pages are displayed as being in watchlist

Screen Shot 2018-02-27 at 6.35.21 PM.png (580×552 px, 54 KB)

Change 415478 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Don't try to load watch stars for special page search results

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

Change 415478 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Don't try to load watch stars for special page search results

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

Jdlrobson updated the task description. (Show Details)
Jdlrobson added a subscriber: pmiazga.

Looks like Anthony tested that, I'll sign off this task

pmiazga updated the task description. (Show Details)
pmiazga removed a project: Patch-For-Review.