Jump to content

Template talk:Cite Q

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
(Redirected from Module talk:Cite Q/sandbox)
Latest comment: 3 hours ago by Jonathanischoice in topic Split the missing names tracking category

Invisible testcase diffs

[edit]

Some of the diffs in the test cases are due to URL encoding differences in the Z39.88 OpenURL metadata (look for it using the span.Z3988 CSS selector) where the title has characters that need URL encoding, e.g. a single-quote or ampersand, e.g. Thom%26%2339%3Bs+Irish+Who%26%2339%3Bs+Who in the live code (left) vs. Thom%27s+Irish+Who%27s+Who in the sandbox (right). Which is odd, because there aren't any code differences I can see in the sandbox that would do that, and I've tried purging the cache etc. It's pretty minor, but noting here for the record. — Jonathanischoice (talk) 01:10, 2 September 2026 (UTC)Reply

More recently, there is a pending change in upstream CS1 code that changes the bibcode URL to use the new Scixplorer site, while the live templates are still using the old harvard.edu URL. Hopefully this update will trickle through to our test cases soon. — Jonathanischoice (talk) 04:44, 19 October 2026 (UTC)Reply

Use with Harvard short footnotes and sfn whitelist

[edit]

Split new topic from discussion above: problems using shortened footnotes with Cite Q, now that last names are accessible to CS1 and citerefs are correctly formed, example: tuba article, § Bibliography section.

Do we still need to add {{sfn whitelist}}? I’m still getting false positives. Elrondil (talk) 11:19, 3 October 2026 (UTC)Reply
Yes, that's why I suggested adding |ref={{sfnref|...}} instead, which serves to circumvent false positives and serve as an ID when looking at wiki markup. Jonathanischoice (talk) 18:35, 3 October 2026 (UTC)Reply
As an example, I've just updated the {{Cite Q}} sources in the Tuba#Bibliography section with |ref= instead of having to spell out all the author and editor details. — Jonathanischoice (talk) 19:21, 3 October 2026 (UTC)Reply
Problematic, that. For example, this:
{{Cite Q|Q134349391 |ref={{sfnref|Adler-McKean|2020}} }}
Adler-McKean, Jack (2020). The Techniques of Tuba Playing (in multiple languages). Kassel: Bärenreiter. ISBN 978-3-7618-2421-4. OCLC 1201192145. Wikidata Q134349391.
causes cs1|2 to emit the maintenance message: CS1 maint: ref duplicates default. It does that because cs1|2 creates a CITEREF anchor ID from |author-last1=Adler-McKean and |publication-date=2020 which exactly matches the CITEREF anchor ID created by {{sfnref}}:
{{sfnref|Adler-McKean|2020}} → CITEREFAdler-McKean2020
This is why we created {{sfn whitelist}}.
—Trappist the monk (talk) 00:02, 4 October 2026 (UTC)Reply
@Trappist the monk well I'm only doing it to avoid the sea of red text the Harvard warning script produces without it, so which end of the proceedings can we most easily fix? — Jonathanischoice (talk) 00:17, 4 October 2026 (UTC)Reply
If the |ref= matches then it is superfluous (hence the warning), and if it doesn’t match then it is overriding data from its Wikidata item.
A HTML comment after the {{cite Q}} solves the identification problem in {{Refbegin}}/{{Refend}} blocks, and if we stick the {{sfn}}/{{sfnp}} for it into the comment it also adds value, in a structured way. For example: *{{cite Q|Q134349391}}<!-- {{sfnp|Adler-McKean|2020}} -->. At least manually, as a convention (for now). Elrondil (talk) 00:37, 4 October 2026 (UTC)Reply
Yes, but the HTML comment alone won't eliminate the wall of red false positives text from the Harvard errors script. Wouldn't it be better to make that script cleverer somehow, or, as you more or less say above, somehow subst that comment in automatically? I can't figure out which is the cart, which the horse, whether the stable door is bolted, who's trying to make who drink, and how much further these horse metaphors can go. — Jonathanischoice (talk) 03:04, 4 October 2026 (UTC)Reply
I suspect, but don’t know, a technical limitation is the reason {{sfn whitelist}} exists. Probably as a less-than-ideal but least-of-all-evils compromise kind of thing. The same technical limitation why it can’t be fixed in {{cite Q}} itself, where it belongs.
Getting back to horses … 😁 … my earlier suggestion to extend |expand= was to support the workflow of markup editors getting the {{cite Q}} into the page. I was proposing editors could use a new |expand= value to {{subst}} their {{cite Q}} in along with an HTML comment that would identify that {{cite Q}}.
Changing horses mid-race … is it possible to make {{subst:cite Q|Q134349391 |expand=with-whitelist}} (for example) end up with {{cite Q|Q134349391}}{{sfn whitelist |CITEREFAdler-McKean2020 }} in the actual page markup? So that editors don’t have to type that ridiculous {{sfn whitelist}} in? That might be the most pragmatic compromise upon an existing compromise; i.e., just more technical debt. Elrondil (talk) 07:36, 4 October 2026 (UTC)Reply
But yes, overnight I ended up using {{sfn whitelist}} instead of |ref=. Elrondil (talk) 00:51, 4 October 2026 (UTC)Reply
Jonathanischoice, try using {{sfn whitelist |{{subst:sfnref|Adler-McKean|2020}} }} to add {{sfn whitelist |CITEREFAdler-McKean2020 }}. I suspect the whole point for {{sfn whitelist}} is to get the expanded CITEREFAdler-McKean2020 into the page so the warning can be suppressed. But the above will let you at least USE {{sfnref}} to BUILD the {{sfn whitelist}}. Elrondil (talk) 06:44, 4 October 2026 (UTC)Reply
The HTML comment would only be needed if {{sfn whitelist}} becomes unnecessary. Elrondil (talk) 00:56, 4 October 2026 (UTC)Reply
I'm trying out {{sfn whitelist}} on the Tuba article, on the first entry in the Bibliography section (Adler-McKean, 2020). For some reason, I can't use {{sfnref}} inside {{sfn whitelist}}, which would provide a handy id for markup editors:
  • {{Cite Q|Q134349391}} {{sfn whitelist | {{sfnref|Adler-McKean|2020}} }}
This doesn't remove the (false positive) error, sfn error: no target: CITEREFAdler-McKean2020. Using the raw citeref seems to remove the error, but is less obvious to editors using harv/sfn:
  • {{Cite Q|Q134349391}} {{sfn whitelist | CITEREFAdler-McKean2020 }}
So could we make {{sfn whitelist}} expand its parameters, or is it using magical invokes? Or, could we make CS1 not emit duplicate ref errors for Cite Q, because really, does it even matter?
— Jonathanischoice (talk) 03:51, 4 October 2026 (UTC)Reply
@Trappist the monk: Do you know why the technical limitations described at Category:Harv and Sfn template errors#Details exists for {{cite Q}}? Why can’t “the article reader” compute CITEREF for {{cite Q}}? Is it possible (1) for {{cite Q}} to compute CITEREF, or (2) for {{cite Q}} to cache intermediate but expensive data (somewhere?!?!) that “the article reader” can then use for a lightweight computation of CITEREF? Elrondil (talk) 11:18, 4 October 2026 (UTC)Reply
The article reader reads wikitext. You type {{Cite Q|Q134349391}} and {{sfn|Adler-McKean|2020}} into an editor and click Publish. MediaWiki reads that wikitext and eventually calls Module:Footnotes to expand the {{sfn}} template. As part of the expansion, Module:Footnotes reads the article wikitext using the article reader in Module:Footnotes/anchor id list (only once when expanding the first {{sfn}} or {{harv}}-family template). The article reader sees only the text that you typed. It cannot see the result of a {{Cite Q|Q134349391}} expansion so cannot know that the author is Adler-McKean and that the publication date is 2020.
{{cite q}} can certainly compute a CITEREF anchor ID but it can only be used internally while that particular template is being expanded.
There is no mechanism in MediaWiki that allows individual templates to 'cache' anything.
—Trappist the monk (talk) 14:02, 4 October 2026 (UTC)Reply
@Trappist the monk @Elrondil how about this: when using sfn/harv, add a |ref= to Cite Q as above, mainly for human ID, and in the code set it to nil if it matches the Wikidata item (so the wrapped citation template doesn't emit a duplicate ref message), and emit a cs1-maint message when it doesn't match. That would suppress existing false positive ref not found errors, and the duplicate ref errors, and usefully tell us when the WD item is changed/updated and no longer matches the ref. — Jonathanischoice (talk) 18:49, 4 October 2026 (UTC)Reply
Probably works. Module:Cite Q should not emit cs1|2 maintenance messages. That functionality is reserved to the Module:Citation/CS1 suite. So try it. The code that creates a CITEREF anchor ID is at lines 4363–4384 in Module:Citation/CS1.
—Trappist the monk (talk) 19:17, 4 October 2026 (UTC)Reply
I will give it a go. Would it be weird to ask for the CS1 make_citeref_id function (line 1385) to be exported so we can use it here as cs1.make_citeref_id or does that clobber the template entry points? — Jonathanischoice (talk) 08:54, 5 October 2026 (UTC)Reply
Thank you for your explanation Trappist the monk.
So if the article reader can see the text I typed, which includes the QIDs in {{cite Q}}, can it also work out a subset of the data that {{cite Q}} worked out, specifically the ordered list of author surnames? Elrondil (talk) 10:37, 5 October 2026 (UTC)Reply
@Trappist the monk: Why can’t the article reader use the text I typed, namely the QID in the {{cite Q}}, to work out a subset of the data that {{cite Q}} was able to work out, namely the list of author surnames and the year/date to compute a CITEREF? Elrondil (talk) 03:06, 10 October 2026 (UTC)Reply
I don't think that I've ever said that it can't. It probably can if you want to put the time into adding that functionality to to the Module:Footnotes suite. I don't know if the duplicated accesses to WikiData will cause the same issue as discussed at Template talk:Cite Q § Recent changes cause errors when checking Wikidata items with hundreds of authors.
—Trappist the monk (talk) 22:25, 10 October 2026 (UTC)Reply
Thank you Trappist the monk. Sorry to imply you had said it can’t; I just re-read my post again, and I now see the poor wording on my part. Apologies.
The problem you mention was about hundreds of authors, solved seemingly by only getting the first N that are needed, hopefully possible here too. Only need surnames here, but yes, it would need to be tried. Elrondil (talk) 23:06, 10 October 2026 (UTC)Reply

There has been a fair bit of improvement and bug fixing in the last couple of weeks since this was discussed. Supplying a |ref= value yourself with {{Cite Q}}, without also specifying author/editor details, will now act to dispel the CS1 "ref duplicates default" error and the need for {{sfn whitelist}}. You're on your own once you supply the author/editor details though, and until recently that was probably the best way to deal with using Harvard short footnotes. Happily though, in the long run that should no longer be necessary in the majority of cases, because Cite Q can now deal with last names. Does anyone have any further analysis, thoughts, bugs, etc. or can we mark this as done? — Jonathanischoice (talk) 20:47, 20 October 2026 (UTC)Reply

@Jonathanischoice: Before moving on, which I’m happy to do, I would like to express my sincerest gratitude to you for your stirling efforts. Thank you VERY much Jonathanischoice!
My only suggestion for “icing on the cake” so to speak would be something to make adding {{cite Q}} easier. For example, letting {{subst:cite Q |Q136027509 |year=2019a |expand=ref}} evaluate to {{cite Q |Q136027509 |year=2019a |ref={{sfnref |Herbert |Myers |Wallace |2019a }}}}. But it would be a convenience, and I appreciate you probably just want to move on 😀. Elrondil (talk) 05:13, 21 October 2026 (UTC)Reply
If done, that would need a different template name, say {{subst:cite Q sfn|.... Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits; 12:54, 21 October 2026 (UTC)Reply
I'm not sure I'd know how to do that, subst is magic fairy dust... — Jonathanischoice (talk) 06:02, 27 October 2026 (UTC)Reply


Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits; 14:19, 31 October 2026 (UTC)Reply

Use on visual editor

[edit]

As I was asked above to provide insights, I did some quick tests to check how Cite Q works on visual editor, and it doesn't very well.

First I tried the Cite button and 4 options are displayed in manual mode: website, book, news journal. No option to cite a wikidata item. So then I went to the automatic option and entered the QID. This did work quite well - it found the reference and extracted all the relevant details but used {{cite journal}} and not {{cite Q}}. So any updates to the wikidata item would not be reflected in the article.

Then I tried to add template Cite Q. This worked as expected, but with a couple of issues. Firstly you do not get the <ref> or </ref> tags and I don't know how to add them except with the source editor. And also there are only prompts for 3 parameters instead of the ~50 parameters which are supported. So the TemplateData needs improving. — Martin (MSGJ · talk) 21:19, 2 October 2026 (UTC)Reply

Thank you for this! It would be good to get (someone who can get) this working nicely with the VE code. I fear that I know very little about how the VE and citation templates all hang together. — Jonathanischoice (talk) 03:22, 3 October 2026 (UTC)Reply
For the first part, in VE, use Cite > Manual > Basic, then type {{ to bring up the template dialogue (this is hacky, if anyone knows a better way to invoke that dialogue, at this point, please tell us). In the template dialogue, type "Cite Q", without the {{.
As to TemplateData, we could add all the parameters from {{Cite journal}}. {{Cite book}}, etc. here, but it would be better if that system had an option to say "...and transclude all the parameters from this other template(s)", for wrappers such as this. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits; 16:41, 4 October 2026 (UTC)Reply
For now, I've added |pages=, which would seem to be the most-needed, to TemplateData. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits; 16:58, 4 October 2026 (UTC)Reply
I didn't even know about that {{ hack so I doubt many other editors do. Would it be best to get it added to that main menu, i.e. Website, Book, News, Journal, WikiCite (or whatever wording is clearest)? I think this can be achieved by editing MediaWiki:Cite-tool-definition.json but will require strong consensus — Martin (MSGJ · talk) 08:30, 5 October 2026 (UTC)Reply

Categories on non-article pages

[edit]

We should perhaps disable the display of categories such as "Cite Q - cites a retracted work" on pages that are not articles. (Perhaps also allowing them on Template: pages, for testing.) Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits; 16:03, 4 October 2026 (UTC)Reply

Draft:, Template:, and Wikipedia: namespace are useful to track. Headbomb {t · c · p · b} 21:23, 4 October 2026 (UTC)Reply

Bug in undocumented APA style

[edit]

There's a seemingly undocumented feature for APA style references. I'm not sure where/if it's used. I was looking into it because it matches the style of the IUCN Red List's citations, and thought it may give a way to include a given name in the Wikidata reference item but show it with a first initial when displayed on Wikipedia.

How it's meant to work: If name-list-style=apa is included, Cite Q will use initials instead of given names (presumably following the APA Style Guidelines). Here's an example of it working correctly:

✅ {{cite Q|Q141678321|name-list-style=apa}}:

Johnson, C. N.; Woinarski, J. C. Z.; Burbidge, A. A. (2025). "Potorous longipes". IUCN Red List. doi:10.2305/iucn.uk.2025-1.rlts.t18102a258661420.en. Wikidata Q141678321.

The code behind this feature (in Module:Cite Q) has a couple of issues. It finds each initial by taking the first byte of a name instead of the first character, which causes an error for a first name that doesn't start with a plain ascii character. For example, it can't handle a name like Øivind, as in this example, which gives an error:

❌ {{cite Q|Q21131829|name-list-style=apa}}: [now fixed]

Ørstavik, Ø.; Manfra, O.; Andressen, K. W.; Andersen, G. Ø.; Skomedal, T.; Osnes, J.; Levy, F. O.; Krobert, K. A. (2015). "The inotropic effect of the active metabolite of levosimendan, OR-1896, is mediated through inhibition of PDE3 in rat ventricular myocardium". PLOS One. 10 (3): e0115547. Bibcode:2015PLoSO..1015547O. doi:10.1371/journal.pone.0115547. PMC 4349697. PMID 25738589. Wikidata Q21131829.{{cite journal}}: CS1 maint: article number as page number (link)

(Above showed "Lua error: bad argument #1 to 'gsub' (string is not UTF-8)." instead of a reference)

Another more subtle issue is that it needs a space between names or initials, but often initials are joined with a dot and no space, so some initials can get lost. For example "Bergen, Stuart W.A." becomes "Bergen, S. W." (the 'A.' disappears):

❌ {{cite Q|Q21146972|name-list-style=apa}}: [now fixed]

Bergen, S. W. A.; Antoniou, A. (2004). "Design of Ultraspherical Window Functions with Prescribed Spectral Characteristics". EURASIP Journal on Advances in Signal Processing. 2004 (13): 2053–2065. doi:10.1155/s1110865704403114. Wikidata Q21146972.

(Above showed "Bergen, S. W.;" instead of "Bergen, S. W. A.;")

Here's the code to fix it, which I have not applied:

local function getInitials(str)
	local initials = {}
	for word in mw.ustring.gmatch(str, '[^%s%.]+') do
		table.insert(initials, mw.ustring.upper(mw.ustring.sub(word, 1, 1)))
	end
	return initials
end

Here's the current code the above replaces:

local function getInitials(str)
	local initials = {}
	for _, word in pairs(mw.text.split(str, ' ', true)) do
		local initial = mw.text.trim(word)
        if #initial > 0 then
            table.insert(initials, initial:sub(1, 1):upper())
        end
	end
	return initials
end

I have no idea where this feature came from, what its history or status is, or why it's undocumented. My wild guess is it was a planned feature but got stuck on similar issues to these and was abandoned but left in the code. If it's fixed, people would still need to reach consensus on whether to use it I guess? Also if it was accepted, and become a documented feature, it would be nice if it had a more memorable syntax, like `style=apa` or just `apa` —Pengo 15:36, 9 October 2026 (UTC)Reply

Please feel free to apply your fix in the Sandbox. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits; 15:45, 9 October 2026 (UTC)Reply
@Pengo guilty as charged, I meant to do more with this, and hit someone else whose name started with Á. This was a feature requested last month that was never finished, which is why it is still undocumented. Thanks for taking a look at it; I wonder if it should go into CS1 code, alongside the existing handling of |name-list-style=vanc, or just be a standalone Cite Q thing with a different parameter name? Esp. since APA style also involves other layout decisions, not just initials with dots. — Jonathanischoice (talk) 00:48, 11 October 2026 (UTC)Reply
Ah, cool. No problems. I should have looked at the history.
It appears to be working in the sandbox version if I add "/sandbox" to my examples above, but not sure how to test it against all the other test cases properly. I'll leave it to you to apply as you feel fit.
I don't have a strong opinion on whether to add it to the main CS1 code, but I think maybe I'd be able to make use of it (for IUCN refs) if it was available for non-Q cites too. —Pengo 09:59, 11 October 2026 (UTC)Reply

Publisher

[edit]

@Jonathanischoice hi Jonathan noticed that cite q was truncating published names like d:Q141759990 the publisher is showing as "Ministry for Cities" rather than "Ministry for Cities, Environment, Regions & Transport" TheLoyalOrder (talk) 22:52, 17 October 2026 (UTC)Reply

@TheLoyalOrder interesting, that looks like a problem with the comma in the title, and that there are two publisher values, so it's trying to split by comma, possibly. I'll have a look. — Jonathanischoice (talk) 03:48, 18 October 2026 (UTC)Reply
hi jonathan the issue was there before i added the second publisher TheLoyalOrder (talk) 03:51, 18 October 2026 (UTC)Reply

Pseudonym qualifers

[edit]

{{Cite Q|Q19869279}} renders (with |editor1=unset) as:

Miles, Barry; Mabbett, Andy (1994), Pink Floyd: A Visual Documentary, OCLC 34651221, OL 1944105W, Wikidata Q19869279

(yes, that's me). However, my co-author uses the mononym "Miles". On Q19869279 his author (P50) is qualified with that string as pseudonym (P742).

Can we make use of such qualifiers? Also object of statement named as (P1932)? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits; 14:54, 18 October 2026 (UTC)Reply

I would be very much in favour of "object named as" qualifiers overriding the author's Wikidata label. It makes a lot of sense on Wikidata to have Chris Jackson's full name as his label as there are SO many people with similar names. But it looks weird having that in his list of publications. Preserving the name string associated with a particular publication is also useful in cases where people have changed their name. DrThneed (talk) 04:30, 19 October 2026 (UTC)Reply
Odd... there's code in there that I haven't touched that is supposed to be using object of statement named as (P1932) where specified, so I'll take a look. It should be easy to add support for pseudonym (P742), which raises an obvious question: when both are specified, which would take precedence? — Jonathanischoice (talk) 04:40, 19 October 2026 (UTC)Reply

Citeref vs. author display count

[edit]

As @Jonesey95 pointed out above, the default {{Cite Q}} author display limit of three authors (+ "et al.") does not match the CS1 limit of four authors when creating a Citeref using {{sfn}} family templates. Should we up the Cite Q limit to four, to match the Harvard short footnote style? The code limits the display of authors/editors to three, or eight, depending on context, and these may be arbitrary, or there may have been good reasons, perhaps discussed in the talk archive. — Jonathanischoice (talk) 20:51, 20 October 2026 (UTC)Reply

Wikispecies issue

[edit]

I just imported to Wikispecies:

  • this template
  • Module:Cite Q
  • Module:Cite Q/config
  • Module:Cite
  • Module:Cite/config

and now, on species:Homo bodoensis, it generates a "URL–wikilink conflict" error and displays on the page, in part:

"[[Template:Roksandic et al., 2021|Resolving the "muddle in the middle": The case for Homo bodoensis sp. nov]]"

with that entire string linked to https://doi.org/10.1002%2Fevan.21929 - species:Template:Roksandic et al., 2021 would be the correct link target.

What needs to be fixed and can it be done here, without detriment to this project? or does something need to be changed in one of the /config modules? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits; 16:31, 21 October 2026 (UTC)Reply

I am not going to propose a fix. It looks to me that this is how the title gets wikilinked:
lines 721–723 create title_display: Resolving the “muddle in the middle”: The case for Homo bodoensis sp. nov
line 727 creates slink: Template:Roksandic et al., 2021 – see the bottom of d:Q109321060
line 743 creates wrap_title: Resolving the “muddle in the middle”: The case for Homo bodoensis sp. nov
line 767 creates citeq_args.title
'[[' .. slink .. '|' .. wrap_title .. ']]'
'[[' .. Template:Roksandic et al., 2021 .. '|' .. Resolving the “muddle in the middle”: The case for Homo bodoensis sp. nov .. ']]'
[[Template:Roksandic et al., 2021|Resolving the “muddle in the middle”: The case for Homo bodoensis sp. nov]]
Resolving the “muddle in the middle”: The case for Homo bodoensis sp. nov – redlinked here because we don't have {{Roksandic et al., 2021}}
That wikilinked title is linked to the doi because species:Template:Roksandic et al., 2021 sets |doi-access=free so {{cite journal}} links |title= with the same link as it uses for |doi=. When cs1|2 detects a url / wikilink conflict, the wikilinked title is nowiki'd and the result linked to the target specified by |url=.
—Trappist the monk (talk) 17:42, 21 October 2026 (UTC)Reply
"because species:Template:Roksandic et al., 2021 sets doi-access=free"
Thank you, but removing |doi-access=free doesn't make any difference to the issue; see species:User:Pigsonthewing/sandbox; nor to the displayed access icon. It seems to be coming from Wikidata, as it does here:
{{cite q| Q109321060 |authorlink1=Mirjana Roksandic |last1=Roksandic |first1=M. |authorlink2=Predrag Radović |last2=Radović |first2=P. |authorlink3=Xiu-Jie Wu |last3=Wu |first3=X.-J. |authorlink4=Christopher J. Bae |last4=Bae |first4=C.J. |journal=Evolutionary Anthropology |publication-date=2021}}
Roksandic, M.; Radović, P.; Wu, X.-J.; Bae, C.J. (2021). "Resolving the "muddle in the middle": The case for Homo bodoensis sp. nov". Evolutionary Anthropology. 31 (1): 20–29. doi:10.1002/evan.21929. Wikidata Q109321060.
Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits; 21:00, 21 October 2026 (UTC)Reply
Until this fairly recent edit, |doi-access=free was required to show the access icon for all free-to-read dois. Now Module:Cite Q uses Module:Citation/CS1/Configuration to automatically add |doi-access=free for those dois that cs1|2 knows to be free-to-read. The reason that the Roksandic et al title is linked to the doi source remains the same. |doi-access=free in species:Template:Roksandic et al., 2021 is now superfluous.
—Trappist the monk (talk) 22:09, 21 October 2026 (UTC)Reply
The DOI (P356) statement on the above item has an online access status (P6954) qualifier set to open access (Q232932), which {{Cite Q}} will pass on as |doi-access=free to the underlying template. Hope that helps? — Jonathanischoice (talk) 01:22, 22 October 2026 (UTC)Reply

Citations with no authors and supplied citeref error

[edit]

Here's something from the tracking category Category:Cite Q - supplied citeref does not match for which a solution is not immediately obvious. In the Bombing of Braunschweig and Bombing of Hamburg in World War II articles, there are citations for the monthly RAF Bomber Command campaign diaries, which have no authors. The citations rightly enough have custom |ref= values, using 1944a, 1944b, etc. for each month. For example, the January 1944 diary:

The problem appears when {{Cite Q}} is supplied with a |ref= value, in this case |ref={{sfnref|''Bomber Command''|1944a}} which does not match the Wikidata value CITEREF2005. This is calculated from the online 2005 date in publication date (P577) and the absence of any author or editor names. It's a bit of a puzzle... there are possibly several different ways to solve this:

  1. in Wikidata, using the special no value in an author (P50) statement,
  2. possibly also with something appropriate in an object of statement named as (P1932) or similar qualifier;
  3. changing, or adding another value to, the instance of (P31) statement e.g. logbook (Q1414013), report (Q10870555), or similar,
  4. somehow accommodating this situation, and possibly others, in the code for {{Cite Q}},
  5. relaxing or changing some of how {{Cite Q}} handles a supplied |ref= parameter, e.g. by adding a |ignore-citeref-errors= or something to that effect.

What do we think? — Jonathanischoice (talk) 03:11, 22 October 2026 (UTC)Reply

Options also include:
  • set the author in Wikidata to be Bomber Command
  • Create a new item for "Bomber Command personnel", and use that
  • Use "Bomber Command personnel" as an author-name-string
  • If Cite Q finds no author in Wikidata, generate the citeref value using the name of the publisher
-- Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits; 09:52, 22 October 2026 (UTC)Reply
To illustrate the issue:
{{Cite Q|Q131325860|ref={{sfnref|''Bomber Command''|1944a}}}}
{{Citation |archive-date=6 July 2007 |archive-url=https://webarchive.nationalarchives.gov.uk/ukgwa/20070706054904/http://www.raf.mod.uk/bombercommand/jan44.html |id=[[WDQ (identifier)|Wikidata]]&nbsp;[[:d:Q131325860|Q131325860]] |language=en |publication-date=6 April 2005 |publisher=[[Royal Air Force]] |ref=CITEREFBomber_Command1944a |series=Campaign Diary |title=January 1944 |url=http://www.raf.mod.uk/bombercommand/jan44.html}}
January 1944, Campaign Diary, Royal Air Force, 6 April 2005, Wikidata Q131325860, archived from the original on 6 July 2007
cs1|2 does not create a CITEREF anchor ID from date alone; at least one contributor / author / editor is required. {{cite q}} should not use a different mechanism to create CITEREF anchor IDs.
In the expansion above, |instance-of=Q3331189 is not a cs1|2 parameter so probably should not be included in the expansion as if it were a native cs1|2 parameter. If it must be retained for some reason, it should be wrapped in html comment markup
<!-- |instance-of=Q3331189 -->.
|publisher=[[Royal Air Force|Royal Air Force]] In piped wikilinks, when both sides of the pipe are the same, the pipe and the link-label should be removed:
|publisher=[[Royal Air Force]]
As for the form of the citation, {{cite q}} is treating this source as if it were a book; 'January 1944' is italicized as a book title is. This archive snapshot suggests that 'January 1944' is a section of a larger whole so perhaps the proper form for this source is something akin to this:
{{cite book |section=January 1944 |title=Bomber Command Campaign Diary |publisher=[[Royal Air Force]] |date=2005 |section-url=http://www.raf.mod.uk/bombercommand/jan44.html |archive-url=https://webarchive.nationalarchives.gov.uk/ukgwa/20070706054904/http://www.raf.mod.uk/bombercommand/jan44.html |archive-date=6 July 2007}}
"January 1944". Bomber Command Campaign Diary. Royal Air Force. 2005. Archived from the original on 6 July 2007.
—Trappist the monk (talk) 14:07, 22 October 2026 (UTC)Reply
On Wikidata, Campaign Diary, January 1944 (Q131325860) is classed as an instance of version, edition or translation (Q3331189), as are many thousands of other works. If not "as if it were a book", how should "version, edition or translation" be treated?
Or is Q131325860 wrongly classed?
"at least one contributor / author / editor is required" What if, as in this case, none is known? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits; 14:26, 22 October 2026 (UTC)Reply
Yes, I might have gotten that wrong (based on it being diaries, plural, and the originals being written during the war while these were published in 2005). But perfection is the enemy of progress, and the beauty of Wikidata is needing to change it in just one spot 😃. Elrondil (talk) 15:09, 22 October 2026 (UTC)Reply
(edit conflict)
Looking at this archive snapshot, it seems to me that that page and the associated subpages were created to commemorate RAF Bomber Command's 60th anniversary so not a 'version, edition or translation' of some other work. Because the 'Bomber Command Campaign Diary' is constructed book-like with sections or chapters, a book-like citation format seems to me to be most appropriate. Wikidata should recognize this source's form and record it appropriately.
When there are no contributors / authors / editors in a cs1|2 template, Module:Citation/CS1 does not create a CITEREF anchor ID – you are looking for an id= attribute in the <cite> tag:
{{cite book |title=Title |date=2026}}
{{#parsoidfragment:62}}<cite class="citation book cs1">''Title''. 2026.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Title&rft.date=2026&rfr_id=info%3Asid%2Fen.wikipedia.org%3ATemplate+talk%3ACite+Q" class="Z3988"></span>
Title. 2026.
It has been pretty much ever thus – the pre-Lua {{citation/core}} renderer requires |ref=harv to create a CITEREF anchor ID:
{{cite book/old |title=Title |date=2026 |ref=harv}}
<span class="citation book" >&#32;''Title''.&#32;2026.</span><span class="Z3988" title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Title&rft.date=2026&rfr_id=info:sid/en.wikipedia.org:Template_talk:Cite_Q"><span style="display: none;">&nbsp;</span></span>
Title. 2026. 
Creating some sort of anchor ID when cs1|2 does not have enough information to self-create one is what the |ref= parameter is for. In the example from the OP, |ref={{sfnref|''Bomber Command''|1944a}} does just that.
—Trappist the monk (talk) 15:14, 22 October 2026 (UTC)Reply
"not a 'version, edition or translation' of some other work"—It is a 'version or edition' of a work in Wikidata's modelling, see d:Wikidata:WikiProject Books#Bibliographic properties. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits; 15:56, 22 October 2026 (UTC)Reply
These things were written, by people, they’re just not known. Adopting convention over configuration, may I please suggest "unknown value" for author (P50) to express this in Wikidata (where {{cite Q}} can then adopt any work/journal as the “author” in the CITEREF, and if there is no work/journal then use publisher)? And also let {{cite Q}} accommodate it being overridden (i.e., configured, using |ref=; see related principle of least astonishment) in the article's wikitext? Elrondil (talk) 14:29, 22 October 2026 (UTC)Reply
That's what I was thinking, since the original authors are certainly uncredited. The instance of ought to have "logbook" as a second value, the more I think of it, since that's what it is. It is also a vers/ed/transl because the item is referring to a specific online rendition of the original written material, however that existed (is it a dusty brown WW2 era folio in an archive building somewhere?). For expediency it might make sense to use the magic "no value" for author (P50) qualified with object of statement named as (P1932) = "RAF Bomber Command" or some such, as Andy suggests. — Jonathanischoice (talk) 22:46, 22 October 2026 (UTC)Reply
Doesn’t author (P50) say to use "unknown value" instead of anonymous when the author is unknown? But both “no value” and “unknown value” make sense here, so maybe {{cite Q}} can do the right thing for both? Elrondil (talk) 00:30, 24 October 2026 (UTC)Reply
Would diary (Q185598) also work for instance of (P31)? Elrondil (talk) 00:34, 24 October 2026 (UTC)Reply
I like the expediency of using object of statement named as (P1932) to provide a value once and for all, but saying “author is unknown” AND “author is named as XYZ” at the same time is also a contradiction. Is there a “assume author” or something along these lines, to express “we don’t know, so we’re assuming it’s XYZ”? Elrondil (talk) 00:44, 24 October 2026 (UTC)Reply
Additionally, the reason I added some special handling for checking if the supplied |ref= was identical to the Wikidata one, was so that we can avoid passing it to the underlying CS1 template, so it doesn't generate the "ref duplicates default" error, since there's no way for the Harvard error scripts to "see" the last names and year from the markup (it happens too early in the piece). So, maybe this error is something that shouldn't be displayed in red, which in some of these remaining cases is just scaring the horses? — Jonathanischoice (talk) 22:50, 22 October 2026 (UTC)Reply
Maybe a warning instead? Elrondil (talk) 00:49, 24 October 2026 (UTC)Reply

Documentation

[edit]

Since {{Cite Q|https://www.wikidata.org/wiki/Q141881149}} works just fine:

Weinstock, Maia (2026). "Margaret Hamilton obituary: computer scientist who pioneered software engineering and helped us get to the Moon" (PDF). Nature. 658 (8137): 865–865. doi:10.1038/d41586-026-03233-6. Wikidata Q141881149.

it would be well to document this to help confused editors. Thanks. StarryGrandma (talk)

I'd rather we generated a warning with a tracking category for such cases. They certainly shouldn't be recommended.
Perhaps we can find someone who operates one of the cleanup bots to do a regular sweep and fix them? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits; 08:54, 27 October 2026 (UTC)Reply
I've made it bail completely with an error message, see QID parameter testcases, as it seems to me that it could be exploited somehow. Is there a valid case for wanting to use multiple QIDs, e.g. {{Cite Q|Q12345 Q67890}} which currently produces two citations? — Jonathanischoice (talk) 00:37, 2 November 2026 (UTC)Reply
1) sounds good and 2) I don't think so.
Is "missing names" in Template:Cite Q/testcases#Editor-in-chief now broken in the sandbox? (Note Paul Dzul, for example) Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits; 00:45, 2 November 2026 (UTC)Reply

Split the missing names tracking category

[edit]

I have deployed the fixes on sandbox to live, and in sandbox split out the tracking category for missing names so that author name string (P2093) is in its own (sub) category; see Category:Cite Q - author name strings with missing given and family names. Also updated their descriptions and linked to the error message in the template docs. If there's no objections we can drop that into live this weekend some time. — Jonathanischoice (talk) 23:57, 30 October 2026 (UTC)Reply

Seems to work well; thank you. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits; 14:17, 31 October 2026 (UTC)Reply
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Summary: deployed to live. — Jonathanischoice (talk) 01:55, 3 November 2026 (UTC)Reply