Page MenuHomePhabricator

Special:RecordImpression and banner history not correctly registering when banners are hidden on non-article namespaces.
Closed, ResolvedPublic1 Estimated Story Points

Description

Looking at this banner... At the end of the banner content, we have the following inside a <script> tag:

$(document).ready(function() {

    [...]

    /* Hide banner outside of main namespace (and Main Page, for sites where that isn't in main namespace) */
    if ( mw.config.get('wgNamespaceNumber') > 0 && !mw.config.get('wgIsMainPage') ) {
        mw.centralNotice.bannerData.hideResult = true;
        mw.centralNotice.bannerData.hideReason = 'namespace';
    }

    if (!mw.centralNotice.bannerData.hideResult) {
        fundraisingBanner.show();
    }

});

It seems that we need to move the code that sets mw.centralNotice.bannerData outside the $(document).ready() function, so that it runs before alterImpressionData() is called.

Event Timeline

AndyRussG claimed this task.
AndyRussG raised the priority of this task from to Unbreak Now!.
AndyRussG updated the task description. (Show Details)
AndyRussG moved this task to Backlog on the Fundraising Sprint Yo La Tengo board.
AndyRussG added subscribers: AndyRussG, Pcoombe, Ejegg and 4 others.
AndyRussG set Security to None.
AndyRussG edited a custom field.
AndyRussG moved this task from Backlog to Doing on the Fundraising Sprint Yo La Tengo board.
AndyRussG added subscribers: DStrine, atgo.

Great, thanks @AndyRussG. I've fixed it for our template banners too.