Modulo:Senato.it: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m rimuovo errore inatteso quando sono assenti le legislature su Wikidata (cfr. talk)
la tabella legs non dovrebbe essere sostituita col valore nil (vedi discussione); rimuovo pcall superflua
 
Riga 57:
-- allora ricava la/e legislatura/e (P2937)
local leg = mWikidata._formatQualifiers(claim, PROP_LEGISLATURA)
if leg == nil then
return nil
else
for l in string.gmatch(leg, "(%w+)") do
table.insert(legs, formatLegislatura(l))
Line 91 ⟶ 89:
-- gestione messaggi e categorie di errore
local err = select(2, pcall(function ()
if id == nil and id_from_WD == nil then
returnerr = paramError('id', leg and true or false)
elseif #legs == 0 and leg then
returnerr = formatError("il numero di legislatura indicato è errato")
elseif #legs == 0 then
returnerr = paramError('legislatura', id and true or false)
end
end))
if err then