Page MenuHomePhabricator

bannerController.js prevents unregistered users from dismissing local sitenotices
Closed, InvalidPublic

Description

Per Brion's bug 9209 comment 4, making the sitenotice dismissable (and loaded via JavaScript) for unregistered users is one of the main requirements of the DismissableSiteNotice extension.

That feature now works again, but CentralNotice breaks it. See T59732#1130711

Event Timeline

Nemo_bis created this task.Mar 19 2015, 7:10 AM
Nemo_bis raised the priority of this task from to High.
Nemo_bis updated the task description. (Show Details)
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 19 2015, 7:10 AM

Nemo, looking deeper into the CentralNotice code, I can't see anything that prevents anons from dismissing the notice. Could it be a specific banner that didn't have a close button added to it for anyone, anon or logged-in? Apparently this isn't automatic with CentralNotice, probably in order to allow styling it individually. Could you point to one such banner that you can't dismiss?

See for example the following banner from HE Wikipedia - it displays the WMIL_WomenMonth banner and has a hide option:

When looking at the banner code, it's obvious that the hide button is manually specified.

I would still like to go with a different approach, of adding a hide button automatically if one isn't already specified in the banner (by class, maybe) - but that's totally up to the Wikimedia folks.

@Nemo_bis: Could you explain why this is high priority?

I don't really understand this bug. CentralNotice is wholly separate from local sitenotices, and has had the option to dismiss for anonymous users for a long time. It does have to be added to the banners when coding them, but we include a button to make this a one step addition (and most banners are copied from previous ones anyway).

@Nemo_bis where are you seeing a conflict?

See for example the following banner from HE Wikipedia - it displays the WMIL_WomenMonth banner and has a hide option:

That banner seems a centralnotice, not a sitenotice.

@Nemo_bis where are you seeing a conflict?

I can't find a single sitenotice on Wikimedia wikis that can be dismissed by unregistered users: can you?

I don't know the reason, but FreedomFighterSparrow said that dismissing works with DismissableSiteNotice without CentralNotice installed, while bannerController.js overrides that feature.

I actually have no idea where to find *local* sitenotices. Could you point
me at one so I can try to debug?

Nemo_bis added a comment.EditedMar 20 2015, 8:54 PM

Examples of undismissable sitenotices:

There are hundreds and they're all the same, you can certainly find more without forcing me to point to every example. :)

P.s.:

I actually have no idea where to find *local* sitenotices. Could you point
me at one so I can try to debug?

Oh, sorry. You can open some random wiki from Special:SiteMatrix, or search "MediaWiki:Sitenotice" in your favourite search engine.

No, that's great - thanks! I'll try to look into it.

So, it's a silly little thing - it's $wgDismissableSiteNoticeForAnons (an "s" at the end), but the config files (CommonSettings.php) have:

$wgDismissableSiteNoticeForAnon = true; // Bug 57732

That needs to be fixed. CentralNotice doesn't have anything to do with it.

atgo added a subscriber: atgo.Mar 20 2015, 9:17 PM

Where should we file this if not CentralNotice?

Aklapper set Security to None.

If anybody would like to create a software patch (developer access, Gerrit tutorial) to change the server configuration: The file to change for this request is https://git.wikimedia.org/blob/operations%2Fmediawiki-config.git/HEAD/wmf-config%2FCommonSettings.php

This bug should be closed as invalid; the original bug, T59732, should be a request to (operations project "operations/mediawiki-config"). It's not even a new request, just a typo fix. @Nemo_bis, @brion - know anybody we could ping?

Glaisher closed this task as Invalid.Mar 22 2015, 8:46 AM
Glaisher claimed this task.
Glaisher added a subscriber: Glaisher.
Mjbmr moved this task from Backlog to Done on the Wikimedia-Site-requests board.May 4 2015, 2:22 PM