Page MenuHomePhabricator

exception in module-execute in module ext.centralNotice.startUp: Cannot read property 'name' of undefined / "campaign is undefined
Closed, ResolvedPublic

Description

Seeing this on mobile (https://en.m.wikipedia.beta.wmflabs.org/wiki/Main_Page) on Chrome:

exception in module-execute in module ext.centralNotice.startUp:
load.php?lang=en&modules=startup&only=scripts&raw=1&skin=minerva&target=mobile:2 TypeError: Cannot read property 'name' of undefined
    at makePossibleBanners (<anonymous>:237:76)
    at Object.chooseBanner (<anonymous>:239:228)
    at reallyChooseAndMaybeDisplay (<anonymous>:222:751)
    at fire (load.php?lang=en&modules=ext.eventLogging|ext.growthExperiments.Help%2CHelpPanel|jquery%2Coojs-ui-core%2Coojs-ui-widgets|mediawiki.ui.anchor|mobile.init%2Cstartup|mobile.pagesummary.styles|mobile.placeholder.images|skins.minerva.mainMenu.styles|skins.minerva.options%2Cscripts&skin=minerva&version=48bcp:83)
    at Object.add [as done] (load.php?lang=en&modules=ext.eventLogging|ext.growthExperiments.Help%2CHelpPanel|jquery%2Coojs-ui-core%2Coojs-ui-widgets|mediawiki.ui.anchor|mobile.init%2Cstartup|mobile.pagesummary.styles|mobile.placeholder.images|skins.minerva.mainMenu.styles|skins.minerva.options%2Cscripts&skin=minerva&version=48bcp:84)
    at Object.always (load.php?lang=en&modules=ext.eventLogging|ext.growthExperiments.Help%2CHelpPanel|jquery%2Coojs-ui-core%2Coojs-ui-widgets|mediawiki.ui.anchor|mobile.init%2Cstartup|mobile.pagesummary.styles|mobile.placeholder.images|skins.minerva.mainMenu.styles|skins.minerva.options%2Cscripts&skin=minerva&version=48bcp:86)
    at Object.chooseAndMaybeDisplay (<anonymous>:224:976)
    at <anonymous>:244:125
    at index.js (<anonymous>:244:405)
    at runScript (load.php?lang=en&modules=startup&only=scripts&raw=1&skin=minerva&target=mobile:13)
logError @ load.php?lang=en&modules=startup&only=scripts&raw=1&skin=minerva&target=mobile:2

On Firefox I see:

TypeError: "campaign is undefined"

Details

Related Gerrit Patches:
mediawiki/extensions/CentralNotice : masterCampaign is null by default in reallyChooseAndMaybeDisplay

Event Timeline

Jdlrobson created this task.Oct 3 2019, 5:22 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 3 2019, 5:22 PM
Jdlrobson renamed this task from exception in module-execute in module ext.centralNotice.startUp: Cannot read property 'name' of undefined to exception in module-execute in module ext.centralNotice.startUp: Cannot read property 'name' of undefined / "campaign is undefined.Oct 3 2019, 5:22 PM
DStrine triaged this task as Unbreak Now! priority.Oct 3 2019, 5:26 PM
Restricted Application added subscribers: Pcoombe, Liuxinyu970226. · View Herald TranscriptOct 3 2019, 5:26 PM

Change 540657 had a related patch set uploaded (by Mepps; owner: Mepps):
[mediawiki/extensions/CentralNotice@master] Add handling for undefined campaign in reallyChooseAndMaybeDisplay

https://gerrit.wikimedia.org/r/540657

I couldn't reproduce locally, but based on what I saw stepping through the debugger, it looks like when there is no campaign or iterations, the campaign variable is undefined. There is logic for the campaign being null but not undefined. I assumed we'd handle both the same way and added an or campaign === undefined. @AndyRussG Let me know what you think!

Change 540657 merged by jenkins-bot:
[mediawiki/extensions/CentralNotice@master] Campaign is null by default in reallyChooseAndMaybeDisplay

https://gerrit.wikimedia.org/r/540657

AndyRussG assigned this task to mepps.Oct 8 2019, 6:16 PM
Restricted Application added a subscriber: Masumrezarock100. · View Herald TranscriptOct 15 2019, 8:30 PM
DStrine closed this task as Resolved.Oct 29 2019, 8:40 PM