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 parse newFromText <anonymous> http://dev.wiki.local.wmftest.net:8080/w/resources/src/mediawiki.special.watchlist/watchlist.js?962bc:67 jQuery 2 dispatch handle load.php:1448:5
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
- As one user, edit https://test.wikipedia.org/wiki/100
- As another user, add https://test.wikipedia.org/wiki/100 to your watchlist
- Go to https://test.wikipedia.org/wiki/Special:Watchlist
- Click the x next to https://test.wikipedia.org/wiki/100
Expected behavior: There should be a javascript popup saying you have unwatched the article
Observed behavior: Takes you to https://test.wikipedia.org/wiki/100?action=watch (and you see an error in the browser console)
Environment
Browser: Firefox 78.
Wiki(s): MediaWiki 1.36.0-alpha (36a0784).