Skip ref param handling when authors and editors are supplied as params
This commit is contained in:
parent
ed199defcb
commit
3ed3baa833
1 changed files with 15 additions and 4 deletions
|
|
@ -770,19 +770,28 @@ local function _cite_q (citeq_args)
|
|||
and not is_set (citeq_args.surname) and not is_set (citeq_args.surname1)
|
||||
and not is_set (citeq_args['author-last']) and not is_set (citeq_args['author-last1']) and not is_set (citeq_args['author1-last'])
|
||||
and not is_set (citeq_args['author-surname']) and not is_set (citeq_args['author-surname1']) and not is_set (citeq_args['author1-surname1']) then -- if neither are set, try to get authors from Wikidata
|
||||
names.authors = get_name_list ('author', citeq_args, qid, wdl) -- modify citeq_args table with authors from Wikidata
|
||||
names.authors = get_name_list ('author', citeq_args, qid, wdl) or {} -- modify citeq_args table with authors from Wikidata
|
||||
else
|
||||
names.authors = {}
|
||||
names.authors_overridden = true
|
||||
end
|
||||
|
||||
if not is_set (citeq_args.editor) and not is_set (citeq_args.editor1)
|
||||
and not is_set (citeq_args['editor-last']) and not is_set (citeq_args['editor-last1']) and not is_set (citeq_args['editor1-last'])
|
||||
and not is_set (citeq_args['editor-surname']) and not is_set (citeq_args['editor-surname1']) and not is_set (citeq_args['editor1-surname']) then -- if neither are set, try to get editors from Wikidata
|
||||
names.editors = get_name_list ('editor', citeq_args, qid, wdl) -- modify citeq_args table with editors from Wikidata
|
||||
names.editors = get_name_list ('editor', citeq_args, qid, wdl) or {} -- modify citeq_args table with editors from Wikidata
|
||||
else
|
||||
names.editors = {}
|
||||
names.editors_overridden = true
|
||||
end
|
||||
|
||||
if not is_set (citeq_args.translator) and not is_set (citeq_args.translator1)
|
||||
and not is_set (citeq_args['translator-last']) and not is_set (citeq_args['translator-last1']) and not is_set (citeq_args['translator1-last'])
|
||||
and not is_set (citeq_args['translator-surname']) and not is_set (citeq_args['translator-surname1']) and not is_set (citeq_args['translator1-surname']) then -- if neither are set, try to get translators from Wikidata
|
||||
names.translators = get_name_list ('translator', citeq_args, qid, wdl) -- modify citeq_args table with translators from Wikidata
|
||||
names.translators = get_name_list ('translator', citeq_args, qid, wdl) or {} -- modify citeq_args table with translators from Wikidata
|
||||
else
|
||||
names.translators = {}
|
||||
names.translators_overridden = true
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -875,7 +884,9 @@ local function _cite_q (citeq_args)
|
|||
|
||||
-- handle supplied {{para|ref}} for readable ID, avoid CS1 duplicate default error
|
||||
local pubyear = yearFromDate(citeq_args['publication-date'])
|
||||
if citeq_args.ref and 'none' ~= citeq_args.ref then
|
||||
if names.authors_overridden or (#names.authors == 0 and names.editors_overridden) then
|
||||
-- if names are supplied manually, then don't mess with supplied ref parameter
|
||||
elseif citeq_args.ref and 'none' ~= citeq_args.ref then
|
||||
local citeref = make_citeref(names.authors or names.editors, pubyear)
|
||||
if citeq_args.ref == citeref then
|
||||
citeq_args.ref = nil -- avoid CS1 maint: ref duplicates default
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue