Page MenuHomePhabricator

Cite: Error message for an empty reference should be more appropriate and helpful
Closed, ResolvedPublic

Description

Steps to reproduce:

1.Click on the "Edit" button
2.Insert a reference with no content.
3.Save the page

Observed Result:

The error message that appears on the page is "Cite error: The opening <ref> tag is malformed or has a bad name" where as
when you edit a reference (not first time insert) to an empty content the error message that appears is "Cite error: There are <ref> tags on this page without content in them"

The later one is more understandable for a user.So maybe we can change the message to the later one.


Version: unspecified
Severity: enhancement

Details

Reference
bz57619

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 2:21 AM
bzimport added projects: Cite, good first bug, I18n.
bzimport set Reference to bz57619.
bzimport added a subscriber: Unknown Object (MLST).
Ryasmeen created this task.Nov 26 2013, 8:29 PM

Created attachment 13912
screenshot

Attached:

Created attachment 13913
Screenshot of the error

Attached:

(Not a VisualEditor-specific issue.)

The examples are on the English Wikipedia, where the cite errors are heavily customized.

  • "Cite error: The opening <ref> tag is malformed or has a bad name" is through "MediaWiki:Cite error ref no key"
  • "Cite error: There are <ref> tags on this page without content in them" is through "MediaWiki:Cite error ref no input"

The test page in question includes '<ref />' which is invalid. This triggers 'MediaWiki:Cite error ref no key'.

The default error message is "Invalid <ref> tag; refs with no content must have a name"

The customized message on enwiki is "The opening <ref> tag is malformed or has a bad name (see the help page)." The linked help page explains the issue in depth.

Rits added a subscriber: Rits.Mar 1 2015, 4:30 PM

i am working on this bug i am unable to generate "Cite error: The opening <ref> tag is malformed or has a bad name" although i am able to generate the "Cite error: There are <ref> tags on this page without content in them" .

Rits added a comment.Mar 1 2015, 5:39 PM

"cite_error_ref_no_key": "Invalid <code>&lt;ref&gt;</code> tag;\nrefs with no content must have a name", is already set to this in the local environment.
should i create a patch for this.

Gadget850 added a comment.EditedMar 1 2015, 6:33 PM

Looking at the original issue:


1.Click on the "Edit" button
2.Insert a reference with no content.
3.Save the page

Observed Result

The error message that appears on the page is Cite error: The opening <ref> tag is malformed or has a bad name.

I don't see this. I create a test page with <ref></ref> and save. The page shows Cite error: There are <ref> tags on this page without content in them (see the help page). which is customized on the English Wikipedia from MediaWiki:Cite error ref no input. This is correct.

Rits added a comment.EditedMar 1 2015, 6:52 PM


when i entered the reference with no content still i had this error
Cite error: Invalid <ref> tag;
refs with no content must have a name

so what should i do
both of them are set to the same message in my en.json
"cite_error_ref_no_key": "Invalid <code>&lt;ref&gt;</code> tag;\nrefs with no content must have a name",
"cite_error_ref_no_input": "Invalid <code>&lt;ref&gt;</code> tag;\nrefs with no name must have content",

Ah.

<ref /> is indeed invalid and triggers MediaWiki:Cite error ref no key which displays Invalid <ref> tag; refs with no content must have a name by default and is customized to The opening <ref> tag is malformed or has a bad name (see the help page). on the English Wikipedia which is a better description.

Rits added a comment.Mar 1 2015, 8:16 PM
This comment was removed by Rits.

Error messages are controlled by MediaWiki interface pages. Enter MediaWiki:Cite error ref no key into the search box and it will open the interface page. These pages have a default, so if it is not customized, the page does not actually exist as such and when you edit it, it shows as if you are creating a brand new page but it shows the default message. If you go to Special:AllMessages you can enter Cite error ref no key and it will show the default and the custom if it exists. If you enter Cite error is will show all cite error interface pages.

Cite.php is the software extension for all of this.
https://www.mediawiki.org/wiki/Extension:Cite

The error messages are set up through cite body.php and then there are language files in the i18n folder.

The English Wikipedia is VERY customized. We use {{broken ref}} to control the message display and the namespace. Every message links to a help page. See https://en.wikipedia.org/wiki/Help:Cite_errors#Error_messages for a list of all messages. Each help page has a Technical section that has a link to the MediaWiki interface page.

jrbs added a subscriber: jrbs.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 29 2015, 11:58 PM

I'm not convinced this is a tone matter.

Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptAug 22 2016, 6:47 PM
Ryasmeen closed this task as Resolved.EditedSep 28 2017, 10:26 PM
Ryasmeen claimed this task.

VisualEditor does not any more allow adding empty reference, so the VE side of the issue is no more reproducible.

Maybe, VE was converting empty reference as <ref/> and therefore it was showing "Cite error: The opening <ref> tag is malformed or has a bad name" , which seems like expected behavior.

Therefore, closing this bug.

Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptSep 28 2017, 10:26 PM