Last modified: 2014-09-08 20:15:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T45013, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 43013 - VisualEditor: Deal with en.wikipedia.org's edit notice system
VisualEditor: Deal with en.wikipedia.org's edit notice system
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
MediaWiki integration (Other open bugs)
unspecified
All All
: Normal normal
: VE-deploy-2013-01-02
Assigned To: Krinkle
:
: 43460 55951 61335 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-12 15:06 UTC by Helder
Modified: 2014-09-08 20:15 UTC (History)
12 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
There is only one notice, but it says there are 2! (136.74 KB, image/png)
2012-12-12 15:06 UTC, Helder
Details

Description Helder 2012-12-12 15:06:08 UTC
Created attachment 11495 [details]
There is only one notice, but it says there are 2!

See the screenshot and also
https://en.wikipedia.org/w/index.php?title=Wikipedia:VisualEditor/Feedback&diff=527687053&oldid=527683727
Comment 1 MZMcBride 2012-12-12 15:48:40 UTC
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.
Comment 2 Erik Moeller 2012-12-12 18:29:46 UTC
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.
Comment 3 Krinkle 2012-12-12 19:07:46 UTC
It counts 2 because there are 2. One from VisualEditor (the default alpha-warning) and one from en.wikipedia.org.

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.
Comment 4 James Forrester 2012-12-12 19:17:56 UTC
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.)
Comment 5 Krinkle 2012-12-12 20:57:57 UTC
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.
Comment 6 Krinkle 2012-12-13 00:27:07 UTC
Change-Id: I65447da8b88a9bae9c24ff155544ff66b3fe9100
Comment 7 Roan Kattouw 2012-12-13 00:56:55 UTC
(In reply to comment #6)
> Change-Id: I65447da8b88a9bae9c24ff155544ff66b3fe9100
Merged by Trevor
Comment 8 Krinkle 2012-12-28 16:51:47 UTC
*** Bug 43460 has been marked as a duplicate of this bug. ***
Comment 9 James Forrester 2013-01-07 17:10:50 UTC
Tagging with deploy-train cycle.
Comment 10 Erik Moeller 2013-12-17 18:43:17 UTC
Regression; this is happening again on en.wp.
Comment 11 Elitre 2014-02-19 19:04:42 UTC
Bug 55951 is possibly a duplicate?
Comment 12 Minh Nguyễn 2014-02-20 07:11:03 UTC
I've proposed a client-side workaround at [[MediaWiki talk:Common.css#Edit notices and VisualEditor]].
Comment 13 James Forrester 2014-03-10 22:20:38 UTC
*** Bug 61335 has been marked as a duplicate of this bug. ***
Comment 14 James Forrester 2014-03-10 23:57:49 UTC
*** Bug 55951 has been marked as a duplicate of this bug. ***
Comment 15 Krinkle 2014-03-12 21:49:46 UTC
(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 https://en.wikipedia.org/w/index.php?title=MediaWiki%3ACommon.css&diff=562641575&oldid=560030040 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 https://gerrit.wikimedia.org/r/#/c/90378/ 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.
Comment 16 Krinkle 2014-03-12 21:54:38 UTC
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.
Comment 17 Gerrit Notification Bot 2014-03-12 22:11:59 UTC
Change 118369 had a related patch set uploaded by Krinkle:
mw.Target: Add class "mw-ve-editNotice" to edit notices

https://gerrit.wikimedia.org/r/118369
Comment 18 Gerrit Notification Bot 2014-03-12 22:15:17 UTC
Change 118369 merged by jenkins-bot:
mw.Target: Add class "mw-ve-editNotice" to edit notices

https://gerrit.wikimedia.org/r/118369
Comment 19 James Forrester 2014-03-12 22:40:23 UTC
Fixed on-wiki.
Comment 20 Spinningspark 2014-08-11 12:39:54 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links