Page MenuHomePhabricator

hideBanner not correctly working on HTTPS notice
Closed, ResolvedPublic

Description

multiple reports coming in via IRC.

The banner can be hiden on one page, but as soon as another page is opened, it reappears.

I can confirm this on enwiki.

The notice in question (generic maintenance one):
https://meta.wikimedia.org/wiki/CentralNotice/Generic_maintenance_notice


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=17108

Details

Reference
bz53116

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:03 AM
bzimport set Reference to bz53116.

ok,

So I've turned off the banner for now to let the cache clear but I've also fixed the issue. When I turn it back on in 15 minutes or so (give it time to clear then test it quickly obviously if I screwed something off I'll wait another 10 minutes after fixing it) it will be hideable.

The fact is indeed the emergency nature which needs it's own individual cookie set up. We have a red warning box on Special:CentralNotice about that but it may not be obvious enough (this is supposed to happen automatically but is not in the software yet). Right now we have a template script set up to help with that for the record:

  1. Make the 'wrapper' div for the banner (in this case siteNoticeWrapper ) display:none.
  2. Add {{MediaWiki:CentralNoticeHideBanner.js}} to the bottom of the banner code.
  3. Save (After saving you may need to refresh the page again as well).
  4. Fill out the new variables that popped up:

4a. hide-cookie-div - the name of the wrapper div (in this case siteNoticeWrapper )
4b. hide-cookie-name - the name of the cookie you want to use (could be the same as another emergency banner for example)
4c. hide-cookie-expire - Expiry length, in days

  1. Make the close button onclick="mw.centralNotice.bannerData.hideBanner()"
  2. Save