Edición de «Módulo:Wikidata»
Puedes deshacer la edición. Antes de deshacer la edición, comprueba la siguiente comparación para verificar que realmente es lo que quieres hacer, y entonces publica los cambios para así efectuar la reversión.
Revisión actual | Tu texto | ||
Línea 204: | Línea 204: | ||
function p.getPropiedad(opciones, declaracion) | function p.getPropiedad(opciones, declaracion) | ||
local propiedad = {} | local propiedad = {} | ||
local tablaOrdenada = {} | |||
-- Resolver alias de propiedad | -- Resolver alias de propiedad | ||
Línea 221: | Línea 222: | ||
return formatoError( 'property-param-not-provided' ) | return formatoError( 'property-param-not-provided' ) | ||
end | end | ||
if declaracion then | if declaracion then | ||
tablaOrdenada = declaracion | tablaOrdenada = declaracion | ||
elseif | elseif not p.getDeclaraciones(opciones.entityId) then | ||
return formatoError( 'other entity' ) | |||
elseif p.getDeclaraciones(opciones.entityId)[mw.ustring.upper(propiedad)] then | |||
tablaOrdenada = p.getDeclaraciones(opciones.entityId)[mw.ustring.upper(propiedad)] | |||
else | else | ||
return '' | return '' | ||
Línea 242: | Línea 244: | ||
end | end | ||
end | end | ||
-- Aplicar filtro de calificador | -- Aplicar filtro de calificador | ||
Línea 616: | Línea 616: | ||
end | end | ||
return f | return f | ||
end | end | ||
Línea 937: | Línea 904: | ||
local valorWikidata; | local valorWikidata; | ||
if (args.prioridad ~= 'sí' or (args.importar and args.importar == 'no')) and args.valor and args.valor ~= '' then | if (args.prioridad ~= 'sí' or (args.importar and args.importar == 'no')) and args.valor and args.valor ~= '' then | ||
valorWikidata = | valorWikidata = ''; | ||
else | else | ||
local ent = SelecionEntidadPorId(argumentos.entityId) | |||
argumentos.entityId = ent and ent.id or nil | |||
valorWikidata = p.getPropiedad(argumentos, nil); | valorWikidata = p.getPropiedad(argumentos, nil); | ||
end | end | ||
Línea 947: | Línea 913: | ||
local categorias = ''; | local categorias = ''; | ||
local namespace = frame:preprocess('{{NAMESPACENUMBER}}'); | local namespace = frame:preprocess('{{NAMESPACENUMBER}}'); | ||
if args.prioridad == 'sí' and valorWikidata | if args.prioridad == 'sí' and valorWikidata ~= '' then -- Si se da el valor sí a prioridad tendrá preferencia el valor de Wikidata | ||
if args.importar and args.importar == 'no' and args.valor and args.valor ~= '' then | if args.importar and args.importar == 'no' and args.valor and args.valor ~= '' then | ||
return args.valor .. categorias | return args.valor .. categorias |