Page MenuHomePhabricator

mediawiki.Title: "title.replace is not a function"
Closed, ResolvedPublicBUG REPORT


What is the problem?

When using the watch/unwatch functionality on Special:Watchlist, I sometimes see:

Uncaught TypeError: title.replace is not a function
    jQuery 2
    jQuery 2

It seems to happen when the title of the page you are watching/unwatching is a number.

The issue appears to occur around here, because it is attempting to call the string function replace() on a number.

Steps to reproduce problem
  1. As one user, edit
  2. As another user, add to your watchlist
  3. Go to
  4. Click the x next to

Expected behavior: There should be a javascript popup saying you have unwatched the article
Observed behavior: Takes you to (and you see an error in the browser console)


Browser: Firefox 78.
Wiki(s): MediaWiki 1.36.0-alpha (36a0784).

Event Timeline

Change 644947 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/core@master] Cast numeric page titles to string

Similar issue will occur for the title "null": (you'd have to test that on Wiktionary, otherwise the first letter is changed to upper-case and it works fine).

Change 644947 merged by jenkins-bot:
[mediawiki/core@master] Cast numeric page titles to string

matmarex assigned this task to Ammarpad.