VisualEditor: Warn user when saving page with <ref>s but not <references />
OpenPublic

Description

When a user saves a page, VE should check for references (<ref>s) created without the de-referencing block (<references /> or {{reflist}} or...) and intervene:

  • prompt them to fix before saving (out of the notices area?);
  • refuse to save before fixed (grey out the save button?); or
  • auto-fix for them (insert a "== References ==\n<references />" section just above the categories), though this (a) sucks, (b) enforces a particular wiki's style on other wikis in code, and (c) would be difficult to internationalise

Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=54906
https://bugzilla.wikimedia.org/show_bug.cgi?id=51260

bzimport set Reference to bz45132.
Jdforrester-WMF created this task.Via LegacyFeb 18 2013, 8:41 PM
Krinkle added a comment.Via ConduitJun 21 2013, 1:08 AM

Currently this would require scanning for the exact html it outputs as the <span style="color:red;">...</a> tag. Which can be tricky to do reliably.

Though the Cite extension could perhaps be the first to give their elements some kind of standard attribute for parse errors, it should probably do more like the TemplateData extension: Refuse to save without it and show a warning there instead. Then the API will return to VE with a nice { error: .. } block containing a error code which we can use to fetch a localised message.

Thryduulf added a comment.Via ConduitJul 30 2013, 10:41 AM

Bug 50779 makes it easy to accidentally delete the references list, so this should check for its presence every save not just when references have been added.

Jdforrester-WMF added a comment.Via ConduitJul 30 2013, 1:52 PM
  • Bug 51910 has been marked as a duplicate of this bug. ***
Thryduulf added a comment.Via ConduitAug 12 2013, 3:59 PM

The auto-fix option in comment 0 has been requested today by en.wp user Mahitgar. If the issues noted can be overcome, then it would be the most user-friendly way forward.

Regarding those issues, it is not obvious why this "sucks" - please could you elucidate?

Internationalisation of the section title could (I guess easily) be achieved by inserting the contents of a MediaWiki page instead of something defined in code. e.g. the equivalent of

{{subst:MediaWiki:Refsection title}}

<{{subst:MediaWiki:Reflist function name}} />

This doesn't solve the option of imposing en.wp style on other wikis though.

Jdforrester-WMF added a comment.Via ConduitAug 14 2013, 10:40 PM

(In reply to comment #4)

The auto-fix option in comment 0 has been requested today by en.wp user
Mahitgar. If the issues noted can be overcome, then it would be the most
user-friendly way forward.

Regarding those issues, it is not obvious why this "sucks" - please could you
elucidate?

Internationalisation of the section title could (I guess easily) be achieved
by
inserting the contents of a MediaWiki page instead of something defined in
code. e.g. the equivalent of

==={{subst:MediaWiki:Refsection title}}===
<{{subst:MediaWiki:Reflist function name}} />

This doesn't solve the option of imposing en.wp style on other wikis though.

Blindly putting the references section at the end of the article seems to not be great (it'd be after the "external links" and "see also" sections, and after any stub or thematic templates).

Jaredzimmerman-WMF added a comment.Via ConduitOct 31 2013, 1:14 AM

The last thing I want us to be doing is adding more error messages. I really think that we can get away with actually fixing the error for people.

I'd rather see us put it in the wrong place and someone have to fix it than us give the user an error they probably don't know how to fix.

Can we do a quick audit of major sites and where they put the reference list? I worry we're worrying a bit too much about about negative feedback that might not be as big a deal as we might think.

Jdforrester-WMF moved this task to Backlog on the VisualEditor workboard.Via WebNov 24 2014, 4:29 PM

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.