Fix Uncaught TypeError: Cannot call method 'substr' of undefined
authorKrinkle <krinkle@users.mediawiki.org>
Wed, 31 Aug 2011 14:37:37 +0000 (14:37 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Wed, 31 Aug 2011 14:37:37 +0000 (14:37 +0000)
commit00a2df687234cbe8de244e659185a9c0a6cf43b1
tree674446e33099d4aa743e7559959a286a4b219083
parentf9320a9119755c241fa4c39e46853da0922bd31d
Fix Uncaught TypeError: Cannot call method 'substr' of undefined
* When changing the name of a category and saving it, this error is thrown from $.ucFirst. Although the script does check for it to be a string, what happens between that and ucFirst is broken. It should always set 'category' of splitresult[0], not just if there is a [1] (=sortkey). Otherwise, if there is no sortkey, 'category' is undefined.
* Also updated outdated comment saying that variable sortkey contains wikitext between "[[Category:Foo" and "]]" (which implies it includes the pipe, which is no longer true)

Follows-up r93351.
resources/mediawiki.page/mediawiki.page.ajaxCategories.js