User:Happy-melon/Cite errors

From Meta, a Wikimedia project coordination wiki

Template:How-to

The Wikipedia footnotes system has the ability to detect errors. This page documents the error messages and provides an understanding of the problem and solutions.

Overview[edit]

Cite.php is the software extension for the footnotes system. Two HTML-style tags are used to define and show the references.

<ref>

Single use footnotes are defined by enclosing content within <ref>...</ref>:

<ref>content</ref>

A footnote used multiple times may be defined with a name:

<ref name="foo">content</ref>

To invoke a named footnote:

<ref name="foo" />

Footnotes may be defined in groups:

<ref group="foo">content</ref>

Names and groups may not be a numeric integer. The quotes are optional unless the name includes a space, punctuation or other mark. It is recommended that names be kept simple and restricted to the standard English alphabet and numerals.

<references />

To display the reference list, after all of the <ref>...</ref> tags, include:

<references />

To display footnoted defined in a group. include:

<references group="foo" />

A common practice is to use the template {{reflist}} to include the <references /> tag with some formatting options.

Error messages[edit]

The messages will show as bold red.

Message Problem Solution
Messages in the body of the article
Invalid <ref> tag; refs with no name must have content There is no content between the <ref>...</ref> tags. Either put content between the <ref> tags (<ref>content</ref>), or (if you're reusing a named reference that's been defined elsewhere in the article) use a single tag <ref name="ref_name" />.
The opening <ref> tag is malformed or has a bad name A named reference has a malformed name. This is produced by a construct like <ref />, which makes no sense. As above, either create a full reference (<ref>content</ref>) or give the tag a name (<ref name="ref_name" />).
Invalid parameter in <ref> tag A named <ref> tag has too many parameters You can only specify two parameters, name= and group=. You can't, for instance, format a reference with <ref style="color:red;">content</ref>, or give it an id.
Invalid <ref> tag; name cannot be a simple integer. Use a descriptive title The name of the reference is a pure number. To avoid naming conflicts (as unnamed references are automatically assigned numbers as names) this is not allowed. Rename the reference to contain at least one letter (eg <ref name="foo" /> instead of <ref name="123" />). It's good practice to give references meaningful names anyway. Make sure that when changing the name you update all the tags that refer to that reference!
Closing </ref> missing for <ref> tag A reference is missing the closing </ref>. Make sure that you are either using a closed pair of tags (<ref>content</ref>), or one single tag with a forward slash at the end to mark it as a single tag (<ref />)
Messages at the end of the article
Invalid <ref> tag; no text was provided for refs named $1 A single ref tag named "foo" (<ref name="foo" />) was invoked, but there is no full reference named "foo" (<ref name="foo">content</ref>) from which to get the reference text. You may have misspelt the reference name, or used special characters that look the same but are actually different. For instance, <ref name="foo-bar">content</ref> and <ref name="foo–bar" /> are not the same: one contains a hyphen while the other uses an ndash. To avoid this sort of error, try to stick to the characters available on the standard keyboard. Alternatively, the full reference may have been removed from the article with other content, such as when removing information under BLP concerns. In this case the text of the reference will be available in the page history, and you can convert the single <ref /> tag into a full reference.
MediaWiki:Cite error references invalid input The <references /> tag is malformed. Using the {{reflist}} template will avoid most of the possible issues with the <references /> tag. See the documentation for details.
Invalid parameter in <references> tag Parameters such as style= or id= were passed to the <references /> tag.
MediaWiki:Cite error references invalid parameters group The <references /> tag is malformed.
Cite error: <ref> tags exist, but no <references /> tag was found
  • The <references /> tag was not included at the end of the article; use {{reflist}}.
  • The reference immediately before <references /> does not have a closing </ref>.
  • There are <ref>...</ref> tags after <references />.
<ref> tags exist for a group named "$1", but no corresponding <references group="$1"/> tag was found
  • The group parameter was used in a reference, but the corresponding <references /> tag was not included with a group parameter; use {{reflist}}.
  • The reference immediately before <references /> does not have a closing </ref>.
  • There are <ref>...</ref> tags using a group after <references />.
Ran out of custom backlink labels. Define more in the MediaWiki:Cite references link many format backlink labels message.
  • A named reference was used more than 702 times, thereby exhausting the list of available labels ("a", "b"... "aa", "ab"... "zy", "zz"). Consider the use of {{cref}} or a similar solution for a reference used a large number of times.
Other messages
MediaWiki:Cite error key str invalid
  • Internal software error.
MediaWiki:Cite error stack invalid input
  • Internal software error.

Tools[edit]

refTools can be enabled via Preferences → Gadgets → refTools. It includes an error checking tool for common problems.

Cleanup categories[edit]

Most of the error messages include {{broken ref}}, which puts the page that triggers the error into Category:Pages with incorrect ref formatting.

The internal message "Cite error group refs without references" puts the page that triggers the error into Category:Wikipedia pages with broken references.

Technical information[edit]

Internal messages are generated by the Cite.php extension and shown as a MediaWiki message. See the Parser hooks section of Special:Version for the installed version of Cite.php. These messages are in the MediaWiki space and can be modified only by admins.

Cite.php internal message MediaWiki message
Cite error[Note 1] Cite error: $1
Cite error key str invalid MediaWiki:Cite error key str invalid
Cite error ref no input Invalid <ref> tag; refs with no name must have content
Cite error ref no key The opening <ref> tag is malformed or has a bad name
Cite error ref numeric key Invalid <ref> tag; name cannot be a simple integer. Use a descriptive title
Cite error ref too many keys Invalid parameter in <ref> tag
Cite error references invalid input MediaWiki:Cite error references invalid input
Cite error references invalid parameters Invalid parameter in <references> tag
Cite error references invalid parameters group MediaWiki:Cite error references invalid parameters group
Cite error references no backlink label Ran out of custom backlink labels. Define more in the MediaWiki:Cite references link many format backlink labels message.
Cite references link many format backlink labels This is a list of the backlink labels used in the reference list, currently from a to zz
Cite error references no text Invalid <ref> tag; no text was provided for refs named $1
Cite error included ref Closing </ref> missing for <ref> tag
Cite error stack invalid input MediaWiki:Cite error stack invalid input
Cite error refs without references[Note 2] Cite error: <ref> tags exist, but no <references /> tag was found
Cite error group refs without references <ref> tags exist for a group named "$1", but no corresponding <references group="$1"/> tag was found
  1. This message adds a prefix to the other messages; it is currently blank.
  2. This message uses namespace detection so the message only shows in articles.