Author: mediawiki
Description:
When several m:Cite.php <ref>s with the same name are used, only the first
reference is considered for rendering by the <references/> tag; this applies
both when the first <ref name=foo> is altogether empty, and when differing
contents occur in multiple such named references.
If this limitation were lifted, editors of pages would have a variety of more
flexible options for organization of references. For example, using non-first
named references when earlier ones were empty would allow references to be
grouped together at the end of an article, or at the end of a section, if
article editors judged this more desirable.
I have examined the code for m:Cite.php, and believe that the fix for this is
below. This change should cause no change in the rendering of articles that use
Cite.php in a bug free manner, but will allow additional uses in the future
and/or fix articles with current reference ordering errors.
- Cite.php 2006-05-04 13:12:19.000000000 -0400
+++ Cite.php.new 2006-05-04 12:47:24.000000000 -0400
@@ -291,7 +291,12 @@
$this->mRefs[$key]['number'] ); } else
- // We've been here before
+ We've been here before
+ $found_text = $this->mRefs[$key]['text'];
+ if ( empty($found_text) and !empty($str)) {
+ If no text found before, use this text
+ $this->mRefs[$key]['text'] = $str;
+ }
return $this->linkRef( $key,
Version: unspecified
Severity: enhancement
URL: http://meta.wikimedia.org/wiki/Talk:Cite/Cite.php#Fixing_non-1st_ref_content