Module talk:Citation/CS1/Archive 10
Appearance
![]() | This is an archive of past discussions about Module:Citation. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 5 | ← | Archive 8 | Archive 9 | Archive 10 | Archive 11 | Archive 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)
- length=10
- pass. LCCN aa12345678.
- pass. LCCN 9912345678.
- fail. LCCN a912345678.
{{cite book}}
: Check|lccn=
value (help) - fail. LCCN 9a12345678.
{{cite book}}
: Check|lccn=
value (help)
- length=11
- pass. LCCN aaa12345678.
- pass. LCCN a9912345678.
- fail. LCCN 99912345678.
{{cite book}}
: Check|lccn=
value (help) - fail. LCCN 9aa12345678.
{{cite book}}
: Check|lccn=
value (help) - fail. LCCN aa912345678.
{{cite book}}
: Check|lccn=
value (help) - fail. LCCN a9a12345678.
{{cite book}}
: Check|lccn=
value (help)
- length=12
- pass. LCCN aa9912345678.
- fail. LCCN 0a9912345678.
{{cite book}}
: Check|lccn=
value (help) - fail. LCCN a09912345678.
{{cite book}}
: Check|lccn=
value (help)
- length=13
- fail. LCCN aa99123456789.
{{cite book}}
: Check|lccn=
value (help)
- If retained, error category will be Category:CS1 errors: LCCN.
- length=12
- fail. LCCN 779912345678.
{{cite book}}
: Check|lccn=
value (help)
- 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- pass. LCCN n78-890351.
- pass. LCCN n78-89035.
- fail (white space). LCCN 78890351 n 78890351.
{{cite book}}
: Check|lccn=
value (help)[http://lccn.loc.gov/n 78890351 n 78890351]
- pass. LCCN 85000002.
- pass. LCCN 85-2.
- pass. LCCN 2001-000002.
- pass. LCCN 75-425165//r75.
- fail (white space). LCCN /AC/r932 79139101 /AC/r932.
{{cite book}}
: Check|lccn=
value (help)[http://lccn.loc.gov/79139101 /AC/r932 79139101 /AC/r932]
- —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)