Page MenuHomePhabricator

[Regression] Exception thrown by mediawiki.action.edit: Cannot read property 'imageFile' of undefined
Closed, InvalidPublic

Description

After mediawiki 1.19 update, Edit toolbar on ml.wikipedia is not being shown.


Version: 1.19
Severity: critical

Details

Reference
bz34920

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 12:19 AM
bzimport set Reference to bz34920.

problem resolved after removing custom js

Problem persists occasionally, even for unregistered users.

It's failing for me as well (logged-in; Chrome 17; Mac).

mw.loader::execute> Exception thrown by mediawiki.action.edit: Cannot read property 'imageFile' of undefined

It's caused by a local script:

mwCustomEditButtons

[undefined, undefined, undefined, undefined, Object , undefined, Object , Object , Object, Object , Object , undefined, Object , Object , Object ]

Those undefined ones cause errors, as it should.

toolbar.addButton could have a guard against this, but on the short term its also a good idea to check the site-wide scripts.

having checked those, I'm surprised, still. I debugged item 5, 6,7 (Object, undefined, Object). And found out that the code generating this is at:

https://ml.wikipedia.org/wiki/MediaWiki:Common.js

However the objects defined there look fine, and when pasting them into the console they also work fine.

Will check further if perhaps one of the special characters of the ml-language is causing ResourceLoader to destroy part of the script.

Found it.

The function lija_rearrange() {} function in MediaWiki:Common.js is doing something. I don't know what the purpose of this function is, but a few times it is references to an array index ([1], [3] etc.) that is empty (undefined).

As a result it is setting some of the items in mwCustomEditButtons (there aliases as 'ext') to undefined.

Marking INVALID as this is not a bug in the software. If you need help with this script, feel free to ask at [[mw:Talk:RL/MGU]] or on irc://irc.freenode.net/#mediawiki