Diferencia entre revisiones de «Módulo:Wikidata»
Restauro la edición anterior con un par de comprobaciones adicionales. |
|||
| Línea 204: | Línea 204: | ||
function p.getPropiedad(opciones, declaracion) | function p.getPropiedad(opciones, declaracion) | ||
local propiedad = {} | local propiedad = {} | ||
-- Resolver alias de propiedad | -- Resolver alias de propiedad | ||
| Línea 222: | Línea 221: | ||
return formatoError( 'property-param-not-provided' ) | return formatoError( 'property-param-not-provided' ) | ||
end | end | ||
local tablaOrdenada | |||
if declaracion then | if declaracion then | ||
tablaOrdenada = declaracion | tablaOrdenada = declaracion | ||
elseif | elseif mw.wikibase.isValidEntityId(tostring(opciones.entityId)) then | ||
tablaOrdenada = mw.wikibase.getAllStatements( opciones.entityId, mw.ustring.upper(propiedad) ) | |||
else | else | ||
return '' | return '' | ||
| Línea 906: | Línea 903: | ||
valorWikidata = ''; | valorWikidata = ''; | ||
else | else | ||
if not mw.wikibase.isValidEntityId(tostring(argumentos.entityId)) then | |||
argumentos.entityId = mw.wikibase.getEntityIdForCurrentPage() or nil | |||
end | |||
valorWikidata = p.getPropiedad(argumentos, nil); | valorWikidata = p.getPropiedad(argumentos, nil); | ||
end | end | ||