Page MenuHomePhabricator

VisualEditor: Deal with's edit notice system
Closed, ResolvedPublic


There is only one notice, but it says there are 2!

See the screenshot and also

Version: unspecified
Severity: normal
See Also:




Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:08 AM
bzimport set Reference to bz43013.
He7d3r created this task.Dec 12 2012, 3:06 PM

Yes, I just came to report the same. Confirming that VisualEditor on the English Wikipedia currently states there are two notices when only one is visible.

It looks to me like it counts the edit notice as such even when none is present?

Separately but relatedly, it would probably be nicer to have features such as adding edit notices in the proposed metadata flyout, as opposed to showing a red link notice to users with the right to create notices.

It counts 2 because there are 2. One from VisualEditor (the default alpha-warning) and one from

English Wikipedia has this self-invented wikitext-organised edit notice system. Long story short, it means there is never not a notice. It always shows something.

In this case the edit notice that it loads is the following html:

<div id="editnotice-area" class="editnotice-area" style="clear: both; width: 100%;"><div class="editnotice-namespace" style="width: 100%;"> </div><div class="editnotice-link editnotice-redlink sysop-show accountcreator-show" style="clear: both; float: right; margin: 0px 0.8em; padding: 0; line-height: 1em; display: none;"> <small><a href="/w/index.php?title=Template:Editnotices/Page/You_Can%27t_Make_a_Heart_Love_Somebody&amp;action=edit&amp;redlink=1" class="new" title="Template:Editnotices/Page/You Can't Make a Heart Love Somebody (page does not exist)">Page notice</a></small> </div><div style="clear: both;"></div> </div>

English Wikipedia uses Template:Editnotices to maintain their notices (embedded from a one-liner in the MediaWiki namespace) since they don't want to restrict it to sysops. Aside from that they want to advertise this template and make it easy to find. So when there is no edit notice, the template outputs a link to create one. This is not created by MediaWiki nor by VisualEditor.

However it isn't a mini-notice with a red link for most users. It is only visible to sysops and account creators (via the CSS class sysop-show and accountcreator-show), so for regular users it is just empty.

So, as a way around this, could we have a hacky exception? Or should we push upstream and suggest that core editnotices are adjusted so that every wiki has enwiki's system? (Presumably this would need a new Editnotice: namespace if they want general availability.)

The only thing we need in core for en.wikipedia to drop this (assuming they still actively want to have these red links) is to show a red link to where the edit notice can be edited/created. Once that is in core, the enwiki's template doesn't have to generate it and thus the actual edit notice will be empty.

As a workaround, I'll work on implementing a small jQuery plugin to calculate the visible text in an element. Then we can simply iterate over the edit notices in VE and ignore the ones with no visible text.

Change-Id: I65447da8b88a9bae9c24ff155544ff66b3fe9100

(In reply to comment #6)

Change-Id: I65447da8b88a9bae9c24ff155544ff66b3fe9100

Merged by Trevor

  • Bug 43460 has been marked as a duplicate of this bug. ***

Tagging with deploy-train cycle.

Regression; this is happening again on en.wp.

Bug 55951 is possibly a duplicate?

mxn added a comment.Feb 20 2014, 7:11 AM

I've proposed a client-side workaround at [[MediaWiki talk:Common.css#Edit notices and VisualEditor]].

  • Bug 61335 has been marked as a duplicate of this bug. ***
  • Bug 55951 has been marked as a duplicate of this bug. ***

(In reply to Erik Moeller from comment #10)

Regression; this is happening again on en.wp.

The system is an en.wikipedia hack, and can't be fixed from within VisualEditor without it knowing more than it should about English Wikipedia.

It comes down to their Editnotice system explicitly creating an edit notice to tell sysops "there are no edit notices on this page, click here to create one", which they present as... an edit notice.

Thus MediaWiki, and by extend VisualEditor, show it as an edit notice.

Last year I put a system in place that allows them to hide these using a css class.

(In reply to Minh Nguyễn from comment #12)

I've proposed a client-side workaround at [[MediaWiki talk:Common.css#Edit
notices and VisualEditor]].

That css was adopted by en.wikipedia as of and that fixed it for them, last year with this:


  • Hide the redlink generated by {{Editnotice}},
  • this overrides the ".sysop-show { display: none; }" above that applies
  • to the same link as well. */

.ve-init-mw-viewPageTarget-toolbar-editNotices-notice .editnotice-redlink {

display: none !important;


Commit accidentally removed this class, thus the above CSS rule no longer applies.

The CSS proposed by Minh on [[MediaWiki talk:Common.css#Edit

notices and VisualEditor]] is a bit too generic in my opinion, I would recommend against that.

Looks like we do have a replacement class that isn't too generic:

.ve-ui-mwNoticesPopupTool-item ...

Though it is an internal class, not one I'd recommend we promote as an API for wikis to use. Let's use that as a temporary replacement, and add another one soon for the long term.

Change 118369 had a related patch set uploaded by Krinkle:
mw.Target: Add class "mw-ve-editNotice" to edit notices

Change 118369 merged by jenkins-bot:
mw.Target: Add class "mw-ve-editNotice" to edit notices

This is still occuring. Pages with no edit notices pop up with "1 notice" when VE is launched. It is not even useful in providing a link to where I *can* add an edit notice.

ori set Security to None.