Last modified: 2014-11-19 17:58:12 UTC
mw.entity.label and mw.wikibase.sitelink are expected to return nil when something is not found, rather than return an empty string. In the old code, via getLabel in mw.wikibase.entity.lua, returning nil is indeed the behavior and i see something like http://snag.gy/aHVqG.jpg (redlinks since i don't have the category / namespace not recognized on my wiki) when labels and site links are not found. from ru.wikipedia.org/wiki/Шаблон:Wikidata -- получение ссылки по идентификатору local link = mw.wikibase.sitelink( entityId ) if link then if label then return '[[' .. link .. '|' .. label .. ']]' else return '[[' .. link .. ']]' end end if label then return label end -- сообщение об отсутвии локализованного названия -- not good, but better than nothing return '[[d:' .. entityId .. '|' .. entityId .. ']]<span style="border-bottom: 1px dotted; cursor: help; white-space: nowrap" title="В Викиданных нет русской подписи к элементу. Вы можете помочь, указав русский вариант подписи.">?</span>' .. categoryLinksToEntitiesWithMissingLabel; end
Change 174443 had a related patch set uploaded by Aude: Return nil when mw.entity.label and sitelink don't find anything https://gerrit.wikimedia.org/r/174443
returning an empty string, the results of using the ruwiki Wikidata module are now like: http://snag.gy/82LD6.jpg for labels and site links not found.
Change 174445 had a related patch set uploaded by Aude: Return nil when mw.entity.label and sitelink don't find anything https://gerrit.wikimedia.org/r/174445
Change 174443 merged by jenkins-bot: Return nil when mw.entity.label and sitelink don't find anything https://gerrit.wikimedia.org/r/174443
Change 174445 merged by jenkins-bot: Return nil when mw.entity.label and sitelink don't find anything https://gerrit.wikimedia.org/r/174445