Emit bad_qid_form error if QID not supplied
This commit is contained in:
parent
0da5fa4047
commit
82013d86de
1 changed files with 3 additions and 4 deletions
|
|
@ -1132,7 +1132,9 @@ local function cite_q (frame)
|
|||
local args = require ('Module:Arguments').getArgs(frame);
|
||||
|
||||
args.qid = args.qid or args[1];
|
||||
if not args.qid then return nil end -- this should return an error message?
|
||||
if not args.qid then
|
||||
return cfg.i18n_t.errors.bad_qid_form .. cfg.i18n_t.trackingcats["invalid-qid"]
|
||||
end
|
||||
args[1] = nil; -- unset; not needed
|
||||
|
||||
local citesep = args.citesep; -- separator string between separate cites of {{cite q|q..., q...}}; any need to keep this?
|
||||
|
|
@ -1152,9 +1154,6 @@ local function cite_q (frame)
|
|||
args.lang = nil
|
||||
|
||||
-- QID as normal form; emit error if not ^Q%d+$ (e.g. a Wikidata URL)
|
||||
-- local qid_form = mw.ustring.match(mw.text.trim(args.qid), "^Q%d+$") or nil
|
||||
-- if not qid_form then
|
||||
-- return ' <span class="error" style="font-size:inherit"><code class="cs1-code">{{[[Template:Cite Q|Cite Q]]}}</code>: QID parameter must be supplied as "Q" followed by digits, e.g. <code class="cs1-code">Q12345</code> ([[Template:Cite Q#Error messages|help]])</span> ' .. cfg.i18n_t.trackingcats["invalid-qid"]
|
||||
if not args.qid:match ('^Q%d+$') then
|
||||
return cfg.i18n_t.errors.bad_qid_form .. cfg.i18n_t.trackingcats["invalid-qid"];
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue