Module talk:Citation/CS1

From Wikipedia, the free encyclopedia
Jump to: navigation, search


When "|author=Y, X " is used we produce which results in Zotero - duplicating the author. Shyamal (talk) 05:09, 31 August 2015 (UTC)

Use |last= and |first= --Redrose64 (talk) 09:28, 31 August 2015 (UTC)

Shyamal: Please do not experiment in the live module. At the beginning of your experiment a large number of articles (essentially everything that uses Module:Citation/CS1) was dumped on the job queue. In the two minute duration of your experiment, hundreds or thousands of articles were changed to reflect the changes caused by your experiment. It may be a while before these changed articles are restored.

|author= and |authors= are free-form parameters. Editors can and do write all kinds of name formats in them. |last= also suffers from this but usually to a much lesser extent. Human names being what they are, getting them right in the COinS must rely on editors getting them right in the cs1|2 templates.

Are you suggesting that the module should not duplicate the first author name in both &rft.aulast= and & That can be done. Does this apply when there is only one author? What about when there is more than one author?

Should &rft.aulast= always be filled even when there is no |first= in the template?

Trappist the monk (talk) 12:01, 31 August 2015 (UTC)

I do not see where I can check the COinS output from the sandbox version which was why I resorted to that foolishness. I have not evaluated all the situations but ideally Zotero import of COinS from Wikipedia articles should produce well-parsed output (whether there are issues in Zotero, I do not know). Users follow either the author= for one author and authorN= for multiple authors OR the alternative form of last= first= (single) and lastN= | firstN= (for multiple authors) - if the last+first/lastN+firstN versions both work fine with Zotero - the same should hold for the author/authorN - ideally. Currently using author results in two authors being listed after COinS parsing by Zotero. Shyamal (talk) 13:05, 31 August 2015 (UTC)
[Tangential question] - @Trappist the monk: - I am unable to find any contents on LUA being handled a job to be queued - my impression was that the idea of LUA was that the code would be executed when a page is requested and that the only things that would get queued would be the caching and cluster synchronization of the code. Shyamal (talk) 15:43, 31 August 2015 (UTC)
That is not how I understand it. I was once told that the server farm caches fully rendered copies of each article. Each time an article is edited, the cached copy is replaced with a newly rendered version. Change to template code takes a while to propagate to all affected pages. This is why it is sometimes necessary to purge or null edit pages.
Trappist the monk (talk) 17:40, 31 August 2015 (UTC)
Changes to the the module sandbox can be evaluated by using the /new versions of the cs1|2 templates, for example:
{{cite book/new |title=Title |last=Last |first=First}}
Last, First. Title. 
To see what the raw module output looks like, wrap the template in {{code}}:
{{code|{{cite book/new |title=Title |last=Last |first=First}}}}
which, for this example gives:
<cite class="citation book">Last, First. ''Title''.</cite><span title="ctx_ver=Z39.88-2004&" class="Z3988"><span style="display:none;">&nbsp;</span></span>
I am not at all sure I understand what you wrote. So rather than attempt a reply based on a misunderstanding, can I ask you to restate and perhaps provide cs1|2 examples of what you mean?
Trappist the monk (talk) 13:42, 31 August 2015 (UTC)
  • Test 1 Green tickY Last, First (2000). Title Test1. 
  • Test 2 Last, First (2000). Title Test2. 
  • Test 3 Last1, First1; Last2, First2 (2000). Title Test3. 
  • Test 4 Green tickY Last1, First1; Last2, First2 (2000). Title Test4. - You are right it seems to be a problem with the author usage - notice that the first author alone gets duplicated in Test 3 Shyamal (talk) 15:39, 31 August 2015 (UTC)

What does the red rectangle mean? What does (first) mean? As a guess, these mean that Zotero found &rft.aulast= without &rft.aufirst= which may or may not be an error because cs1|2 does not have a parameter for corporate authors so they are usually placed in |last= or |author=.
I have extracted the author metadata from your examples:
  • Test 1 Green tickY {{cite book/new |title=Title Test1|last=Last |first=First|year=2000}}
  • Test 2 {{cite book/new | title=Title Test2|author=Last, First|year=2000}}
  • Test 3 {{cite book/new |title=Title Test3| author1=Last1, First1|author2=Last2, First2| year=2000}}
  • Test 4 Green tickY {{cite book/new |title=Title Test4| last1=Last1| first1=First1| last2=Last2| first2=First2| year=2000}}
It is not clear to me that the way Module:Citation/CS1 is doing things is correct. Why does the module concatenate the values from |first= and |last= into a value for & when that author is already identified in &rft.aufirst= and &rft.aulast=? Is this duplication necessary?
Perhaps an experiment is in order. I have hacked Module:Citation/CS1/sandbox so that &rft.aufirst= and &rft.aulast= are only filled when the first author is listed in the cs1|2 template with |first= and |last=.
I have extracted the author metadata from the hacked version of the module using your same examples:
  • Test 1 {{cite book/new |title=Title Test1|last=Last |first=First|year=2000}}
  • Test 2 {{cite book/new | title=Title Test2|author=Last, First|year=2000}}
  • Test 3 {{cite book/new |title=Title Test3| author1=Last1, First1|author2=Last2, First2| year=2000}}
  • Test 4 {{cite book/new |title=Title Test4| last1=Last1| first1=First1| last2=Last2| first2=First2| year=2000}}
So, do your test again using your examples and tell me if the hack makes a positive difference.
Trappist the monk (talk) 17:40, 31 August 2015 (UTC)
Yes! Definitely looks the way it ought to now. Thanks. Shyamal (talk) 02:23, 1 September 2015 (UTC)
Ok, I'll leave the experiment in the code for now.
Trappist the monk (talk) 09:55, 1 September 2015 (UTC)
I missed you other query - the red rectangle shows that the first author is getting duplicated - I suspect that &rft.aulast= is used in cases where only one author in a long list is given and expanded automatically as et al. by Zotero. I hope your fix has no side-effects and that it will be incorporated into the main code at some point. Thanks. Shyamal (talk) 12:16, 1 September 2015 (UTC)

Requested move 9 September 2015[edit]

The following is a closed discussion of a requested move. Please do not modify it. Subsequent comments should be made in a new section on the talk page. Editors desiring to contest the closing decision should consider a move review. No further edits should be made to this section.

The result of the move request was: not moved. Jenks24 (talk) 16:10, 25 September 2015 (UTC)

Module:Citation/CS1Module:Citation/Formatting – CS1 stands for Citation Style 1, but this module is used for Citation Style 1, Citation Style 2, and even Vancouver-style citations. The name "CS1" is a confusing anachronism. Kaldari (talk) 23:20, 9 September 2015 (UTC) Relisted. Jenks24 (talk) 09:16, 17 September 2015 (UTC)

  • As long as this is done in a way that doesn't break citation formatting during the process of the move, it sounds ok. I have frequently complained on Help talk:Citation Style 1 that decisions are made there that affect other citation styles without watchers of those other styles being notified of any discussion, so this sort of name change seems like a move in the right direction to me. —David Eppstein (talk) 00:43, 17 September 2015 (UTC)
Well, if we're going to open this can of worms and move away from "CS1" as the name, we should consider whether "Citation" is the right name for the module, since some people may think that the module is used only for {{Citation}}.
Personally, I think the current name is fine, since anyone who gets here is probably at least a little bit technical and will read the documentation. Let's modify the documentation to make it very clear where this module is used, then call it a day. – Jonesey95 (talk) 03:49, 17 September 2015 (UTC)
  • Comment: I hope that User:Mr Stradivarius or User:Trappist the monk will add their opinions before this is closed, in case the rename turns out to be a bad idea, or in case simultaneous renames are needed. Even if it's a good idea, we don't want to break the world when closing (speaking from bad experience). EdJohnston (talk) 17:26, 17 September 2015 (UTC)

oppose: This feels like a make-work project. If proposer were a regular contributor to discussions here or at Help talk:Citation Style 1 and were proposer to have offered more substantial reasoning than the unsupported declaration that [the] name "CS1" is a confusing anachronism, then it's possible that I might be persuaded that this isn't a make-work project. There are twenty-three cs1|2 templates and their sandboxes that will need to be touched, this module (which will require tweaking so we don't break links to its submodules and sandboxes – which should also move if the main module moves), a deal of documentation, and perhaps other stuff that I haven't thought of that must at least be looked at.

Trappist the monk (talk) 22:40, 17 September 2015 (UTC)

Well, it definitely confused me :P Kaldari (talk) 22:53, 17 September 2015 (UTC)
What's confusing about the first two sentences of the documentation? "This module and associated sub-modules support the Citation Style 1 and Citation Style 2 citation templates. In general, it is not intended to be called directly, but is called by one of the core CS1 and CS2 templates." – Jonesey95 (talk) 00:53, 18 September 2015 (UTC)
  • Strong oppose since the module is in use, and since apparently it must be so crucial to the functionality of this site that it is cascade-protected. Leave it be; moving a module causes more problems than its worth since redirects do not exist in the "Module:" namespace. Moving this page will have severe negative consequences. Steel1943 (talk) 02:00, 18 September 2015 (UTC)
  • oppose This has been at this page location for a long time and probably everyone concerned with it knows what it is, what it’s called. It’s name is not in English but it’s not an article or other page meant for readers of the encyclopaedia, so it’s name does not have to be in English. Many templates and modules have similarly terse names. As for “formatting” it is no more concerned with that then every template on WP that generates HTML, i.e. most of them.--JohnBlackburnewordsdeeds 05:08, 18 September 2015 (UTC)
    • @JohnBlackburne: You completely misunderstood the point here. Nobody said anything like that. The problem is that it uses the name "CS1" to refer to CS1, CS2 and Vancouver citation styles. nyuszika7h (talk) 16:37, 18 September 2015 (UTC)
The only part of Vancouver system styling supported by cs1|2 is the author/editor name-list styling and that, incompletely.
Trappist the monk (talk) 17:30, 18 September 2015 (UTC)

Oppose per Trappist and because the Module's documentation is clear. – Jonesey95 (talk) 03:47, 19 September 2015 (UTC)

The above discussion is preserved as an archive of a requested move. Please do not modify it. Subsequent comments should be made in a new section on this talk page or in a move review. No further edits should be made to this section.

Recent change[edit]

@Trappist the monk: I think the recent change you've made here seems to have changed cite news so that page numbers are simply given as a number, so that for example a citation will now read "14 December 1912. 3. Retrieved 26 August 2015." instead of the old "14 December 1912. p. 3. Retrieved 26 August 2015." (bolding mine). At least I think it was the edit you made here that changed this, but templates/modules at this level of intricacy are beyond my pay-grade. If it is here, can this please be reversed? Example using cite news template:

"Obituary". Footscray Independent. 14 December 1912. p. 3. Retrieved 26 August 2015. 

Cheers, Jenks24 (talk) 18:53, 26 September 2015 (UTC)

Fixed. The function is_valid_parameter_value() is used to test the state of meta-parameter NoPP. If set to yes, true, or y then set the prefix meta-parameters PPrefix and PPPrefix to empty strings. But, is_valid_parameter_value() also considers |nopp= (empty or not present) to be a valid parameter value so the subsequent code dutifully set PPrefix and PPPrefix to empty strings. In all other uses of the function, the meta-parameter that is tested is the same meta-parameter that is set to an empty string when it does not have an acceptable value.
Trappist the monk (talk) 19:56, 26 September 2015 (UTC)
Looks good to me now. Thanks! Jenks24 (talk) 20:12, 26 September 2015 (UTC)

False error message on cite encyclopedia[edit]

There is a template called {{cite DNBIE}} that has been minding its own business for some years. It is a wrapper around {{cite encyclopedia}} until fairly recently it has not had any problems. However now it is reporting an error message in red:

The reason for this has nothing to do with the title line, but is because the encyclopedia parameter is:

Please fix the underlying code ASAP so that it does not report this error as linking in the encyclopedia link ought not to be discouraged in this way. -- PBS (talk) 23:29, 26 September 2015 (UTC)

I have found a simple work around hack. If the lead string is a wiki link then the warning goes away (Simples!)
So while this
  • | encyclopedia =[[Dictionary of National Biography]] [ Index and Epitome]
gives an error. This does not:
  • | encyclopedia =[[w:Dictionary of National Biography|Dictionary of National Biography]] [ Index and Epitome]
-- PBS (talk) 23:47, 26 September 2015 (UTC)
See How to fix this external link error?
Trappist the monk (talk) 12:16, 27 September 2015 (UTC)

{{cite encyclopedia}} is an odd duck. If there is no |title= then |encyclopedia=, if set, is promoted to |title= (this is why there is no missing title error message). It does this for the metadata. So the error message was correct in a sense. I'll see about improving that.

The test is intended to catch exactly the condition that you illustrated in your first post. Links to external cites do not belong in title-holding parameters because that corrupts the metadata. You should not rely on your work-around as a permanent fix. Even though there is no visible error message, the metadata are still corrupt.

{{cite encyclopedia |encyclopedia=[[w:Dictionary of National Biography|Dictionary of National Biography]] [ Index and Epitome]}}

Dictionary of National Biography Index and Epitome.  External link in |title= (help)

produces this metadata for title:


Why does {{cite DNBIE}} not use |title=?

Trappist the monk (talk) 00:10, 27 September 2015 (UTC)

|title= is an optional parameter, which is usually set. I have not given it a value in this example so that it is clear that the problem lies in the handling of |encyclopedia=.
But even if title is set it will not affect the outcome according to the documentation (as |title= gets mapped to |article= in the case of {{cite encyclopedia}}) so the alleged problem and the fault in the error message will remain the same. -- PBS (talk) 01:19, 27 September 2015 (UTC)
I did say that I will work on fixing the error message.
Trappist the monk (talk) 10:14, 27 September 2015 (UTC)
"The test is intended to catch exactly the condition that you illustrated in your first post. Links to external cites do not belong in title-holding parameters because that corrupts the metadata." Who claims it is a corruption to pass an external link into the encyclopedia parameter? -- PBS (talk) 01:23, 27 September 2015 (UTC)
You can see the corrupted data in Trappist's note above. I suggest putting the URL into one of the provided URL parameters, e.g. |url=, |chapter-url=. – Jonesey95 (talk) 02:27, 27 September 2015 (UTC)
A decision was taken long ago to keep |title= and |url= separate. There are separate keywords in the metadata for them. Because {{cite encyclopedia}} promotes |encyclopedia= to |title= when it can, a url in |encyclopedia= ends up in |title= in violation of that decision to keep |url= and |title= separate.
Trappist the monk (talk) 10:14, 27 September 2015 (UTC)

Here's a hack of {{cite encyclopedia}} that links to a wikisource article, links to the Internet archive image of the book, and links to the DNB article in wikipedia:

{{cite encyclopedia | editor-first = Sidney | editor-last = Lee | year = 1903 | article = [[s:Phayre, Robert (DNB00)|Phayre, Robert (DNB00)]] | title=Index and Epitome |encyclopedia=[[Dictionary of National Biography]] |url= |title-link= }}

which produces this; no errors and cleaner metadata:

Lee, Sidney, ed. (1903). "Phayre, Robert (DNB00)". Index and Epitome. Dictionary of National Biography. 

Trappist the monk (talk) 10:14, 27 September 2015 (UTC)

@I a aware that such a change can be made but in doing this you are altering the title which is "Dictionary of National Biography Index and Epitome" (hence the format in the template). I presume you have not looked at the template as the link is in the page parameter. The index only has a very short entry for a subject (usually about a couple of dozen entries a page). If it is acceptable to include a url in pages I fail to see why it is not acceptable to include it in the parameter encyclopedia.
@Jonesey95 Trappist the monk. Where there a consensus that a change would be made in {{cite encyclopedia}} the so that a URL could not be placed in the encyclopedia parameter? -- PBS (talk) 18:51, 29 September 2015 (UTC)
PBS, the discussion was here. I think we might be over-reaching a bit with our URL detection, given that we do not offer a |*-url= parameter that accompanies each parameter that would be useful to match with a URL. As the error category continues to populate, it has become clear that there is a desire among editors to provide useful links to match |journal= and |encyclopedia=, for example. – Jonesey95 (talk) 19:21, 29 September 2015 (UTC)
I don't know that you should make such a presumption about what I have or have not done. The point of my example was to show that |article=, |title=, |work= can all be used in {{cite encyclopedia}} without error and with cleaner metadata, not to explore the minutia of {{cite DNBIE}}. I know that the book title is Dictionary of National Biography Index and Epitome but I chose leave them separate as {{cite DNBIE}} does merely for the sake of example.
Trappist the monk (talk) 21:44, 29 September 2015 (UTC)

Protected edit request on 6 December 2015[edit]

Please implement these changes from the sandbox to restore the ability to use "#" in the "episode-link" parameter of {{cite episode}}, which was possible until these recent changes to the module. This problem was discussed at Help talk:Citation Style 1. As explained there, linking to individual episode entries is valid, widely done and works, but now an error is displayed for no apparent reason. --AussieLegend () 09:39, 6 December 2015 (UTC) AussieLegend () 09:39, 6 December 2015 (UTC)

This module, given its wide usage, is usually changed about once a month. Also, the discussion there does not seem finished. I've disabled the edit-protected request for both reasons. --Izno (talk) 16:24, 6 December 2015 (UTC)
Izno I'm not sure what the update frequency has to do with this problem. As it stands now, there are likely thousands of articles displaying warnings that will confuse editors. These errors shouldn't be displaying and weren't yesterday. When the fix is so simple, I don't see why it shouldn't be fixed. Since you're not somebody who can fix the problem, I'm reactivating the request. Best let an admin sort it out, since only admins can edit this module. As for being still under discussion, there are two parts to the thread at Help talk:Citation Style 1. The issue regarding {{!}} is still being discussed but there's no reason why this can't be fixed. --AussieLegend () 17:03, 6 December 2015 (UTC)

Please don't revert another editor's |answered=yes.

The technical "fix" may be trivial, but it is not sensible at this time without other people agreeing to implement it at this time. (And just because someone made the supposed fix in the sandbox does not mean they necessarily agree with it.) --Izno (talk) 18:00, 6 December 2015 (UTC)

There is nothing stopping an edit request being reactivated. In fact there are specific instructions in the template that say Set the |answered= or |ans= parameter to no to reactivate your request. Only admins can satisfy the request since this template is fully protected and, since you are not an admin, nor do you even hold the Templateeditor permission, you can't adequately satisfy the request. This problem was not a problem before recent edits. Nor were many other problems that have cropped up since the changes. This indicates that the changes were not adequately tested before implementation. I've been writing code, both personally and professionally, for 40 years and would never have made such changes without adequate testing. Granted, much of my professional work was mission critical, dealing with issues of national security, but I can accept that there is not an urgent need to revert the changes fully because these errors are not affecting "the mission" too much. However, implementing a simple change that merely reverts the addition of an error is to be expected. --AussieLegend () 08:23, 7 December 2015 (UTC)

consensus should be obtained before formally making the request. (from WP:Edit requests). The standing consensus in the context of these modules, as I have already pointed out, is that the main template is synced from the sandbox only once in every while. If you are willing to challenge that standing consensus, please do so. Reactivating an edit request is not how you are going to get a change made either to the template or the standing consensus.

Please do not add the {{edit protected}} template merely to attract attention to the change, as it clutters up the relevant edit request category with unactionable requests. also from WP:Edit requests. (Re)activating this edit request has the exact effect proscribed by this sentence.

Administrators/templateeditors may be the only editors able to respond to a fully-protected edit request in the affirmative (that is, may implement the changes). However, I see little reason why any editor responding in the negative could not do so, where that editor knows of a consensus against that change (whether because of evaluation of an RFC related to that change or because of standing consensus as in this case).

changes were not adequately tested I would tend to agree that the module does not have a robust set of test cases, but that's not relevant to this specific request; in fact, an editor on Help talk:CS1 has raised that concern in one or the other of the recent threads after this update. Aside: It is, however, a monumental task with a module of this size.

The rest of your commentary is ad hominem/argument to authority and thus irrelevant. --Izno (talk) 12:23, 7 December 2015 (UTC)

Consensus isn't necessary to request that a change that effectively broke a template be reverted. Before the change there was no error. After the change there was an error when there shouldn't have been. You have to use a little common sense here. The whole point of adding {{edit fully-protected}} is to draw attention to an edit request. The particular section that you've quoted from is about the possibility of a request being controversial. It is meant to stop people saying things like "please add a parameter to display an image" and using a template drawing attention to a discussion that really needs to be fully discussed. A request to implement a simple change to remove an error introduced by an editor is hardly controversial.
I see little reason why any editor responding in the negative could not do so Of course any editor can respond, but the point that you are missing is that you are clearly not in a position to action the request so, while you can comment, you are not in a position to demand that the edit request not be reactivated, which is what you seem to be doing. It's really up to somebody who can action the request to make that demand. --AussieLegend () 13:26, 7 December 2015 (UTC)
@AussieLegend: as far as I can tell from the comments here, it's agreed that this will be fixed at the next round of updates. Peter coxhead (talk) 14:20, 7 December 2015 (UTC)
Yes, that seems to be the case but, in the meantime, editors are going to be confused when they see misleading warning messages about things that are actually perfectly OK. For me, that's a big headache in the TV project. --AussieLegend () 14:30, 7 December 2015 (UTC)


There is a mistake for OL: "endode". Someone should replace it with "encode". --Obsuser (talk) 23:49, 13 December 2015 (UTC)

Fixed. Thanks. That particular typo has been there since 8 April 2013.
Trappist the monk (talk) 00:33, 14 December 2015 (UTC)
It hasn’t been changed yet (it’s in Module:Citation/CS1/Configuration)... --Obsuser (talk) 02:10, 14 December 2015 (UTC)
At en:wp, all changes are made first in the sandbox versions of the cs1|2 modules. Then, once a month or so, we update the live modules with all of the recent changes. So the fix is here.
Trappist the monk (talk) 03:06, 14 December 2015 (UTC)
OK. --Obsuser (talk) 03:22, 14 December 2015 (UTC)

Template:Cite_episode issue[edit]

This template is causing Template:Cite_episode to do the following:

  • Appending %7CAudio: to URLs in links
  • Show the error Check |episode-link= value (help); Check |series-link= value (help); even though the links are valid
  • Render the series= with more than one word to show only the last word in the link

--Lantrix //Talk//Contrib// 17:02, 29 January 2016 (UTC)

It appears Lantrix is referring to reference #732 in Endorsements for the Republican Party presidential primaries, 2016:
  • {{Cite episode |title=Audio: No Agenda Episode 741 - Bad Optics |episode-link= |access-date=2016-01-30 |series=No Agenda |series-link= |city=Austin |number=741 |time=88:18 |transcript=I Adam Curry am as of today officially, officially announcing my full support my endorsement, my coveted endorsement ... for Donald Trump for Republican candidate for the Presidency of the United States of America. |language=English}}
  • "[No Agenda Episode 741 - Bad Optics]". [Agenda]. Episode 741. I Adam Curry am as of today officially, officially announcing my full support my endorsement, my coveted endorsement ... for Donald Trump for Republican candidate for the Presidency of the United States of America. Event occurs at 88:18.  Check |episode-link= value (help); Check |series-link= value (help);
GoingBatty (talk) 18:29, 29 January 2016 (UTC)
@Lantrix: Per Template:Cite episode#Title, the parameters |episode-link= and |series-link= are for linking to a Wikipedia article, whereas |url= is for the URL. Therefore, I think this is what you want:
  • {{Cite episode |title=Audio: No Agenda Episode 741 - Bad Optics |url= |access-date=2016-01-30 |series=No Agenda |series-link=No Agenda |city=Austin |number=741 |time=88:18 |transcript="I Adam Curry am as of today officially, officially announcing my full support my endorsement, my coveted endorsement ... for Donald Trump for Republican candidate for the Presidency of the United States of America."|language=English}}
  • "Audio: No Agenda Episode 741 - Bad Optics". No Agenda. Episode 741. "I Adam Curry am as of today officially, officially announcing my full support my endorsement, my coveted endorsement ... for Donald Trump for Republican candidate for the Presidency of the United States of America". Event occurs at 88:18. Retrieved 2016-01-30. .
Maybe someone else can figure out why there are two periods at the end of the citation. Thanks! GoingBatty (talk) 18:37, 29 January 2016 (UTC)
Facepalm3.svg Facepalm - sorry, my bad. GoingBatty (talk) 18:40, 29 January 2016 (UTC)