Mòdul:Wikidades/proves: diferència entre les revisions

Contingut suprimit Contingut afegit
getParentObjects with label icon in labels
separant upto en number/string, pas previ per migrar a uptolabelid
Línia 1:
-- version 2020111220201117 from master @cawiki
 
local p = {}
Línia 1.506:
editicon,
labelicon,
upto_number,
upto,
upto_label,
upto_linkId,
upto_value,
last_only,
grammatical_case,
include_self)
if upto_linkIdupto_value == nil then upto_linkIdupto_value = "" end
local upto_link_ids = {}
for q in mw.text.gsplit(upto_linkIdupto_value, '[^Q%d]') do
upto_link_ids[resolveEntityId(q)] = true
end
local propertySups = mw.text.split(propertySupString, '[^P%d]')
local lastlabel = uc_first(uptoupto_label or '')
local maxloop = tonumber(uptoupto_number) or ((lastlabel .. upto_linkIdupto_value) == '' and 10 or 50)
local labelFilter = {}
Linha 1.604 ⟶ 1.605:
end
 
-- Returns pairs of instanceparent label and property value fetching a recursive tree
function p.getParentValues(frame)
local args = frame.args or frame -- via invoke or require
Linha 1.619 ⟶ 1.620:
local property_format = getArg(args.formatting)
local label_format = getArg(args.labelformat, "label")
local uptoupto_number = getArg(args.upto)
local last_only = getArg(args.last_only, false)
local labelShow = getArg(args.labelshow)
Linha 1.626 ⟶ 1.627:
local case = getArg(args.case)
local upto_label
if isSet(args.uptolabelid) then
uptoupto_label, _ = getLabelByLangs(args.uptolabelid, languages) -- TODO table of label ids
elseif type(upto_number) == 'string' then
upto_label = upto_number
upto_number = nil
require(wiki.module_title .. '/debug').track('upto') -- replace by uptolabelid
end
Linha 1.650 ⟶ 1.656:
editicon,
labelicon,
uptoupto_number,
upto_label,
args.uptovalueid or args.uptolinkid,
last_only,