Jump to content

Module talk:Citation/CS1/Archive 10

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by ClueBot III (talk | contribs) at 11:10, 30 April 2014 (Archiving 1 discussion from Module talk:Citation/CS1. (BOT)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Archive 5Archive 8Archive 9Archive 10Archive 11Archive 12

Checking for invalid |lccn=

This one won't come up very often, but an invalid |lccn= can make it so that the automatic link to lccn.loc.gov does not work. I came across one in a citation today. I'm guessing that there are approximately a few dozen invalid LCCN parameters in all of WP, but they should be easy to detect.

Here is a straightforward explanation (scroll to "identifier-syntax") of valid LCCN syntax that will work with the LCCN web site. – Jonesey95 (talk) 05:16, 17 March 2014 (UTC)

In Module:Citation/CS1/sandbox:
length=7
  • fail. LCCN 1234567. {{cite book}}: Check |lccn= value (help)
length=8
length=9
length=10
length=11
length=12
length=13
If retained, error category will be Category:CS1 errors: LCCN.
Trappist the monk (talk) 11:31, 20 March 2014 (UTC)
length=12
Looks good to me. – Jonesey95 (talk) 03:55, 21 March 2014 (UTC)

Well, not quite right. The check needs to be improved so that lccns with hyphens are normalized before they are checked.

Trappist the monk (talk) 14:20, 30 March 2014 (UTC)

Ok, I think that I've fixed the issue. New function normalize_lccn() normalizes the lccn according to the Normalization of LCCNs procedure. These test citations all work correctly. normalize_lccn() is able to normalize them all; the two fails are because there are spaces in the lccn that cause improper display of the lccn link
Trappist the monk (talk) 17:41, 30 March 2014 (UTC)
Should the red error message be set to "hidden=true" in the live module until this bug fix is rolled out? I recommend doing so in order to avoid false positives. – Jonesey95 (talk) 00:03, 31 March 2014 (UTC)