Modul:Wikidata utilities: Unterschied zwischen den Versionen
Modul:Wikidata utilities (Quelltext anzeigen)
Version vom 22. November 2020, 10:27 Uhr
, vor 3 Jahrenvereinfacht
(umgestellt) |
(vereinfacht) |
||
Zeile 4: | Zeile 4: | ||
local WikidataUtilities = { | local WikidataUtilities = { | ||
suite = 'WikidataUtilities', | suite = 'WikidataUtilities', | ||
serial = '2020-11- | serial = '2020-11-22', | ||
item = 65439025 | item = 65439025 | ||
} | } | ||
Zeile 80: | Zeile 80: | ||
if not isSet( entity ) then | if not isSet( entity ) then | ||
return nil | return nil | ||
end | end | ||
if type( entity ) == 'string' then -- entity is id | if type( entity ) == 'string' then -- entity is id | ||
Zeile 92: | Zeile 89: | ||
function wu.getSitelinkTable( entity, globalSiteId ) | function wu.getSitelinkTable( entity, globalSiteId ) | ||
if not isSet( entity ) then | if not isSet( entity ) or not isSet( globalSiteId ) then | ||
return nil | return nil | ||
elseif type( entity ) == 'string' then -- entity is id | elseif type( entity ) == 'string' then -- entity is id | ||
entity = mw.wikibase.getEntity( entity ) | entity = mw.wikibase.getEntity( entity ) | ||
end | end | ||
if entity and entity.sitelinks then | if entity and entity.sitelinks then |