Modul:Wikidata utilities: Unterschied zwischen den Versionen

+getEntityId
(+getSitelink)
(+getEntityId)
Zeile 12: Zeile 12:
-- redirect ids marked false, too
-- redirect ids marked false, too
entity = mw.wikibase.getEntity( id )
entity = mw.wikibase.getEntity( id )
end
if not entity then
id = ''
wrongQualifier = true
end
return id, entity, wrongQualifier
end
function fw.getEntityId( id )
local wrongQualifier = false
local entity = nil
if not id or id == '' then
return '', entity, wrongQualifier
end
if mw.wikibase.isValidEntityId( id ) and mw.wikibase.entityExists( id ) then
-- expensive function call
-- redirect ids marked false, too
entity = id
end
end
if not entity then
if not entity then
Anonymer Benutzer