Last modified: 2014-11-01 07:27:27 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 T18854, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16854 - <ref></ref> without <reference/>
<ref></ref> without <reference/>
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Cite (Other open bugs)
unspecified
All All
: Low enhancement with 3 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy, patch
: 17740 26976 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-31 23:49 UTC by Betacommand
Modified: 2014-11-01 07:27 UTC (History)
14 users (show)

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


Attachments
A patch against r45293 to implement an error message when references are not displayed (3.43 KB, patch)
2009-01-01 21:23 UTC, Brad Jorsch
Details
Additional patch to add a check for preview (581 bytes, patch)
2009-01-07 19:58 UTC, Brad Jorsch
Details
Additional patch to add a check for preview, using wpPreview (695 bytes, patch)
2009-01-13 01:39 UTC, Brad Jorsch
Details
Patch to add IsPreview and IsSectionPreview to ParserOptions (2.56 KB, patch)
2009-01-13 20:56 UTC, Brad Jorsch
Details
Additional patch to add a check for preview, using ParserOptions (507 bytes, patch)
2009-01-13 20:57 UTC, Brad Jorsch
Details
Print the footnotes and report the error silently (3.10 KB, patch)
2009-01-29 14:19 UTC, bluehairedlawyer
Details

Description Betacommand 2008-12-31 23:49:21 UTC
There are quite often pages that use <ref> tags but often <references/> are quite often omitted. their should be a method to automatically track these. the best method would probably be a category.
Comment 1 Brad Jorsch 2009-01-01 21:23:38 UTC
Created attachment 5640 [details]
A patch against r45293 to implement an error message when references are not displayed

The normal thing to do seems to be to generate an error message for the error, and then override the default error message on enwiki to include {{broken ref}}. So I've made a patch to do just that.

This patch implements two new error messages, cite_error_refs_without_references (for missing <references/>) and cite_error_group_refs_without_references (for missing <references group="..."/>). In the ParserBeforeTidy hook, Cite.php now appends the appropriate error messages for each missing references tag.

I've also taken the opportunity to fix the "Erroneous refs" parser test that was failing.
Comment 2 Betacommand 2009-01-01 23:00:20 UTC
Is their any method to track those errors? with a category or special page? or will it be a mediawiki namespace notice?
Comment 3 Brad Jorsch 2009-01-02 17:00:34 UTC
Track them by adding a category to the appropriate MediaWiki namespace notices, just as is done with the other errors (e.g. [[MediaWiki:Cite error references no text]]) on enwiki.
Comment 4 Chad H. 2009-01-03 18:59:51 UTC
Patch applied in r45379.
Comment 5 pgrawehr 2009-01-07 07:09:27 UTC
There's a problem with this patch: When editing only a section of an article, the error message is printed in preview mode, although it shouldn't. See [http://test.wikipedia.org/wiki/A_page_with_references_and_sections This test page I created]. Start editing "Section 2" and then click preview. The reference error is generated although the article as a whole *has* a references section. The user should not add a second one. 
Comment 6 Brad Jorsch 2009-01-07 19:58:30 UTC
Created attachment 5649 [details]
Additional patch to add a check for preview

Will it work well enough to just detect when we're doing a preview and not output the error in that case? This patch (apply on top of the first) takes a shot at that.
Comment 7 Chad H. 2009-01-13 00:56:56 UTC
Wouldn't it make sense to check 'wpPreview' && 'wpSection', rather than 'action' being edit or submit. The latter seems too generalized. 
Comment 8 Brad Jorsch 2009-01-13 01:39:52 UTC
Created attachment 5665 [details]
Additional patch to add a check for preview, using wpPreview

Ok. I tried asking how to detect preview mode on IRC before making the previous patch, but no one was interested in answering.
Comment 9 Brion Vibber 2009-01-13 19:05:13 UTC
I don't really like this on general principle (checking GET/POST vars from within a parse operation).

What I think I'd prefer is for the parser to provide some state data for section-ness and preview-ness, just like it carries title and version state. This would allow for extensions to handle previews and section-only display specially without tight coupling to the web UI.

Possibly this best belongs in the ParserOptions state?
Comment 10 Brad Jorsch 2009-01-13 20:56:34 UTC
Created attachment 5672 [details]
Patch to add IsPreview and IsSectionPreview to ParserOptions

Sounds good to me.
Comment 11 Brad Jorsch 2009-01-13 20:57:42 UTC
Created attachment 5673 [details]
Additional patch to add a check for preview, using ParserOptions
Comment 12 Alex Z. 2009-01-26 18:03:08 UTC
Applied in r46270 and r46271.
Comment 13 Melancholie 2009-01-28 06:47:39 UTC
Please see bug 12930 ("Special page for errors during parsing").
Comment 14 bluehairedlawyer 2009-01-28 15:56:39 UTC
Well these already been someone on the Village pump asking if we could output the footnotes instead of the error message and the message has already shown up in Google.

I might suggest we take a quieter to fixing pages without <reference/> tags. Don't produce an error message, do output the footnotes, but also place the page in a category for fixing. This way readers wouldn't never find that a footnote was missing in action. And if editors wanted their footnotes under a different heading or somewhere else then at the bottom of a page, they could still do that.

Moreover adding footnotes to pages without <references/> tags would also be nice way of fixing [[5984]], although I realise there a javascript way of doing this.
Comment 15 bluehairedlawyer 2009-01-28 16:00:28 UTC
That should have been [[bugzilla:5984]]
Comment 16 bluehairedlawyer 2009-01-29 14:19:49 UTC
Created attachment 5745 [details]
Print the footnotes and report the error silently

English Wikipedia have already blanked the error printed by this bug so you'd have to wonder if it was worth the effort in the first place.

Here's a patch that will place footnotes at the bottom of pages which don't have <reference/> tags while silently reporting the error.
Comment 17 Brad Jorsch 2009-01-29 14:43:21 UTC
I disagree, since we already output a big red error message for all ''other'' ref tag errors. But if you want to include the references on the page, change [[MediaWiki:Cite error refs without references]] to something like this:

<code>&lt;references /></code> not supplied. References are:</strong><references /><strong>[[Category:B0rken refs]]

And change [[MediaWiki:Cite error group refs without references]] to the corresponding:

<code>&lt;references group="$1"/&gt;</code> was not supplied. References are:</strong><references group="$1"/><strong>[[Category:B0rken refs]]

(the unbalanced "<strong>" tags in there are to make the reference list itself not be big and red). It wouldn't really solve bug 5984 though, as a section preview with a named ref defined in a different section would show up as broken.
Comment 18 Betacommand 2009-01-29 14:44:57 UTC
What en.wiki did was exactly what I was asking for, a hidden category that is used for tracking these error. huge red error messages are not as graceful as a hidden category. 
Comment 19 bluehairedlawyer 2009-01-29 15:12:57 UTC
I think the most intuitive way of applying the Cite extension would but to display the output of <ref>...</ref> tags without automatically requiring the input of <reference/> tags. New users will see and copy the <ref> tag format but then find out that their footnotes aren't being displayed.
Comment 20 Robert Rohde 2009-01-29 18:46:20 UTC
(In reply to comment #18)
> What en.wiki did was exactly what I was asking for, a hidden category that is
> used for tracking these error. huge red error messages are not as graceful as a
> hidden category. 
> 

Actually enwiki's approach is still badly borked.  Because "Cite error: $1" is used in a filter in front of each error message, changing this specific message to a category results in an output of "Cite error:" with no visible error text, e.g. see [[1949_Grand_Prix_season]] for a current example.

That can be fixed locally, but the solutions are generally inelegant, such as changing cite_error to "$1".

Also, since people apparently don't want this message on talk pages (even as a category), a hack has been added with the effect of killing ALL cite error messages appearing outside the mainspace.  Again, a solution to that could be put together locally but it won't be particularly pretty.

Not to mention that the hard coding of the formatting on cite_error also makes changes to the presentation difficult to implement.
Comment 21 Chad H. 2009-01-29 19:05:04 UTC
(In reply to comment #16) 
> English Wikipedia have already blanked the error printed by this bug so you'd
> have to wonder if it was worth the effort in the first place.
> 

I thought it was a rather informative error. Suggestions welcome on exact wording though. To be honest: it doesn't really matter what enwiki does with the message. Do other communities like it? If the general agreement is in favor, I fail to see how one wiki's actions should cause so much backpedaling. 

> Here's a patch that will place footnotes at the bottom of pages which don't
> have <reference/> tags while silently reporting

Eww eww eww. <references /> is almost never at the bottom, and this will just encourage lazy editing/formatting of pages. I would hope the wiki never outputs markup you didn't add, only warn you when something's wrong.

On semi-related note: if there's issues with how Cite outputs errors, that's for a different bug. Not within the scope of this one.
Comment 22 Robert Rohde 2009-01-29 19:26:13 UTC
(In reply to comment #21)
> (In reply to comment #16) 
> > English Wikipedia have already blanked the error printed by this bug so you'd
> > have to wonder if it was worth the effort in the first place.
> > 
> 
> I thought it was a rather informative error. Suggestions welcome on exact
> wording though. To be honest: it doesn't really matter what enwiki does with
> the message. Do other communities like it? If the general agreement is in
> favor, I fail to see how one wiki's actions should cause so much backpedaling. 
<snip>

I think the primary complaint with the error message isn't the text, but rather that many people saw silently failing as the expected behavior under some circumstances.

Specifically, when one copies text from an article to a talk page for discussion, that text may contain ref tags, but that does not necessarily mean that people want or expect a references section on the talk page.  On enwiki, this modification added error messages to hundreds of pages where no one really thought there was a problem.  Hence people are going out of their way to hide the error message from those pages, since they don't really see it as an error.

Comment 23 Happy-melon 2009-01-31 14:34:47 UTC
IMO the issue here is not that an error message in *X* circumstance or in *Y* circumstance is a Good or Bad Thing, it's that cite.php's error messages are so tied up in hardcoded HTML and each other that it's not possible for individual wikis to properly customise the appearance to suit their own preferences.  We've already 'solved' the original problem as of comment 12, but the deeper issue is that we need to untangle cite.php's error tags so people can actually control them individually without inavdertantly borking the entire set in one. 
Comment 24 Chad H. 2009-03-07 02:41:57 UTC
*** Bug 17740 has been marked as a duplicate of this bug. ***
Comment 25 Mark A. Hershberger 2011-01-27 18:09:18 UTC
*** Bug 26976 has been marked as a duplicate of this bug. ***
Comment 26 Mark A. Hershberger 2011-05-05 22:04:30 UTC
I think the issues have been taken care of and comment 23 refers to a new problem.  Opened bug 28843 for that one.

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


Navigation
Links