Page MenuHomePhabricator

Error Message "TypeError: isMediaViewerEnabledOnClick is not a function" on various Wikipedia Pages
Open, LowPublic

Description

Description:
Logstash is reporting about ~100+ TypeErrors when a user tries to interact with the media viewer or images in general on wiki pages. The error message "TypeError: isMediaViewerEnabledOnClick is not a function" suggests that there might be a bad reference.

Sample Error Log

Timestamp: February 21, 2024, at 20:54:43.614 UTC
Error Type: TypeError
Error Message: isMediaViewerEnabledOnClick is not a function
File URL: https://commons.wikimedia.org/w/load.php?lang=en&modules=ext.centralauth.ForeignApi%7Cext.uls.languagenames%7Cjquery%2Coojs-ui-core%7Cjquery.ui%7Cmediawiki.ForeignApi.core%7Cmediawiki.base%7Cmediawiki.page.ready%7Cmmv.bootstrap%7Cmw.config.values.wbSiteDetails%7Coojs-ui-core.icons%7Coojs-ui-toolbars.icons%7Coojs-ui-widgets.icons%7Coojs-ui-windows.icons%7Coojs-ui.styles.icons-editing-core%2Cicons-interactions%2Cicons-location%2Cicons-movement%2Cindicators%7Cwikibase.WikibaseContentLanguages%2CgetLanguageNameByCode%2CgetUserLanguages%7Cwikibase.mediainfo.filePageDisplay%2Cstatements%7Cwikibase.view.ControllerViewFactory&skin=vector&version=r7vfx
URL: https://commons.wikimedia.org/wiki/File:Albert_Anker_Lesender_Mann.jpg

Steps to Reproduce:

  1. Visit the Wikimedia Commons page for the image "Albert Anker Lesender Mann" using the following URL: https://commons.wikimedia.org/wiki/File:Albert_Anker_Lesender_Mann.jpg
  2. Attempt to interact with the media viewer or related elements on the page.

Expected Behavior:
Users should be able to interact with the media viewer and related elements without encountering errors.

Actual Behavior:
Encountering a TypeError with the message "isMediaViewerEnabledOnClick is not a function" might prevent readers from interacting with the media viewer or images.

Resolution:

  1. Investigate the JavaScript code responsible specifically related to the media viewer functionality.
  2. Ensure that the isMediaViewerEnabledOnClick function is correctly implemented and available for use.

Event Timeline

Hi, I've tested on Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:123.0) Gecko/20100101 Firefox/123.0 in a private window but could not reproduce the error on any of the following pages:

The only error logged to the JS console is Error: View mediainfoview does not exist and seems to be unrelated.

https://commons.wikimedia.org/wiki/Special:Version reports

  • MediaWiki 1.42.0-wmf.20 (df1439a) 01:03, 27 February 2024
  • MultimediaViewer – (2c9767e) 07:36, 26 February 2024

@simon04 given the error rate I think it's an edge case, not something that happens on page load so let's look at the stack traces for some more clues:

On https://pt.wikipedia.org/wiki/Agostinho_de_Hipona

at mouseenter https://es.wikipedia.org/w/load.php?lang=es&modules=ext.centralNotice.choiceData%7Cext.centralauth.centralautologin%7Cext.checkUser.clientHints%7Cext.cite.ux-enhancements%7Cext.cx.uls.quick.actions%7Cext.eventLogging%2CnavigationTiming%2CwikimediaEvents%7Cext.quicksurveys.lib%7Cext.uls.common%2Cinterface%7Cext.urlShortener.toolbar%7Cjquery%2Csite%7Cjquery.uls.data%7Cmediawiki.ForeignApi.core%7Cmediawiki.String%2CTitle%2CUri%2Capi%2Cbase%2Ccookie%2Cexperiments%2Cstorage%2Cuser%2Cutil%7Cmediawiki.page.ready%7Cmediawiki.page.watch.ajax%7Cmmv.bootstrap%7Cmw.cx.SiteMapper%7Coojs-ui.styles.icons-interactions%7Cskins.vector.clientPreferences%2Cjs%7Cskins.vector.icons.js&skin=vector-2022&version=1p057:491:903
at handle https://es.wikipedia.org/w/load.php?lang=es&modules=ext.centralNotice.choiceData%7Cext.centralauth.centralautologin%7Cext.checkUser.clientHints%7Cext.cite.ux-enhancements%7Cext.cx.uls.quick.actions%7Cext.eventLogging%2CnavigationTiming%2CwikimediaEvents%7Cext.quicksurveys.lib%7Cext.uls.common%2Cinterface%7Cext.urlShortener.toolbar%7Cjquery%2Csite%7Cjquery.uls.data%7Cmediawiki.ForeignApi.core%7Cmediawiki.String%2CTitle%2CUri%2Capi%2Cbase%2Ccookie%2Cexperiments%2Cstorage%2Cuser%2Cutil%7Cmediawiki.page.ready%7Cmediawiki.page.watch.ajax%7Cmmv.bootstrap%7Cmw.cx.SiteMapper%7Coojs-ui.styles.icons-interactions%7Cskins.vector.clientPreferences%2Cjs%7Cskins.vector.icons.js&skin=vector-2022&version=1p057:233:217
at dispatch https://es.wikipedia.org/w/load.php?lang=es&modules=ext.centralNotice.choiceData%7Cext.centralauth.centralautologin%7Cext.checkUser.clientHints%7Cext.cite.ux-enhancements%7Cext.cx.uls.quick.actions%7Cext.eventLogging%2CnavigationTiming%2CwikimediaEvents%7Cext.quicksurveys.lib%7Cext.uls.common%2Cinterface%7Cext.urlShortener.toolbar%7Cjquery%2Csite%7Cjquery.uls.data%7Cmediawiki.ForeignApi.core%7Cmediawiki.String%2CTitle%2CUri%2Capi%2Cbase%2Ccookie%2Cexperiments%2Cstorage%2Cuser%2Cutil%7Cmediawiki.page.ready%7Cmediawiki.page.watch.ajax%7Cmmv.bootstrap%7Cmw.cx.SiteMapper%7Coojs-ui.styles.icons-interactions%7Cskins.vector.clientPreferences%2Cjs%7Cskins.vector.icons.js&skin=vector-2022&version=1p057:225:932
at add/elemData.handle https://es.wikipedia.org/w/load.php?lang=es&modules=ext.centralNotice.choiceData%7Cext.centralauth.centralautologin%7Cext.checkUser.clientHints%7Cext.cite.ux-enhancements%7Cext.cx.uls.quick.actions%7Cext.eventLogging%2CnavigationTiming%2CwikimediaEvents%7Cext.quicksurveys.lib%7Cext.uls.common%2Cinterface%7Cext.urlShortener.toolbar%7Cjquery%2Csite%7Cjquery.uls.data%7Cmediawiki.ForeignApi.core%7Cmediawiki.String%2CTitle%2CUri%2Capi%2Cbase%2Ccookie%2Cexperiments%2Cstorage%2Cuser%2Cutil%7Cmediawiki.page.ready%7Cmediawiki.page.watch.ajax%7Cmmv.bootstrap%7Cmw.cx.SiteMapper%7Coojs-ui.styles.icons-interactions%7Cskins.vector.clientPreferences%2Cjs%7Cskins.vector.icons.js&skin=vector-2022&version=1p057:222:565

It suggests this only happens on mouseenter

On https://de.wikipedia.org/wiki/Ti-Plasmid#/media/Datei:Ti-Plasmid.svg

at OptionsDialog.openDialog  https://de.wikipedia.org/w/load.php?lang=de&modules=mmv&skin=vector&version=18t7r:62:349
at OptionsDialog.toggleDialog  https://de.wikipedia.org/w/load.php?lang=de&modules=mmv&skin=vector&version=18t7r:50:959
at https://de.wikipedia.org/w/load.php?lang=de&modules=mmv&skin=vector&version=18t7r:50:767
at fire  https://de.wikipedia.org/w/load.php?lang=de&modules=jquery%2Coojs-ui-core&skin=vector&version=d8j0d:42:705
at Object.fireWith [as resolveWith]  https://de.wikipedia.org/w/load.php?lang=de&modules=jquery%2Coojs-ui-core&skin=vector&version=d8j0d:43:903
at deferred.<computed> [as resolve]  https://de.wikipedia.org/w/load.php?lang=de&modules=jquery%2Coojs-ui-core&skin=vector&version=d8j0d:47:471
at eval  https://de.wikipedia.org/w/load.php?lang=de&modules=mediawiki.base&skin=vector&version=5d4u0:6:691
at Object.enqueue  https://de.wikipedia.org/w/load.php?lang=de&modules=startup&only=scripts&raw=1&skin=vector:10:374
at mw.loader.using  https://de.wikipedia.org/w/load.php?lang=de&modules=mediawiki.base&skin=vector&version=5d4u0:6:650
at OptionsDialog.handleOpenCloseClick  https://de.wikipedia.org/w/load.php?lang=de&modules=mmv&skin=vector&version=18t7r:50:700

OptionsDialog doesn't seem to set this.config anywhere ?

Jdlrobson lowered the priority of this task from Medium to Low.Tue, Jun 4, 10:17 PM