As a logged in user when I try to edit https://en.m.wikipedia.org/wiki/User:Jdlrobson/common.js I get:
Exception in module-execute in module skins.minerva.editor: load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=1rfuz0b:176 TypeError: Cannot read property 'text' of null TypeError: Cannot read property 'text' of null at setupEditor (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=1rfuz0b:4), <anonymous>:182:97) at init (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=1rfuz0b:4), <anonymous>:182:369) at eval (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=1rfuz0b:4), <anonymous>:183:576) at mw.loader.implement.mobile-frontend-editor-disabled (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=1rfuz0b:4), <anonymous>:183:586) at Object.<anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=1rfuz0b:161) at fire (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=1rfuz0b:45) at Object.add [as done] (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=1rfuz0b:45) at Object.always (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=1rfuz0b:46) at runScript (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=1rfuz0b:161) at checkCssHandles (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=1rfuz0b:162)
- This also happens on all pages in the desktop version of the skin: https://en.wikipedia.org/w/index.php?title=Heading&useskin=minerva
- It happens on the ?action=edit page (https://en.m.wikipedia.org/wiki/Columbia_River?action=edit)
Developer notes
Page::getSection assumes the MobileFormatter has been run and looks for the lead section. However on pages which have not been formatted (e.g. pages that are not wikitext such as MediaWiki:Common.js) or desktop pages this blows up.
We'll add a unit test and make sure the editor opens without the section parameter in this case
Test plan
Testing in one browser should be sufficient.
Visit the following URLs and verify that clicking the edit icon works as expected and no errors are thrown in the JS Developer console: