https://bugzilla.wikimedia.org/show_bug.cgi?id=73615

            Bug ID: 73615
           Summary: mw.entity.label and mw.wikibase.sitelink are expected
                    to return nil
           Product: MediaWiki extensions
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: WikidataClient
          Assignee: wikidata-b...@lists.wikimedia.org
          Reporter: aude.w...@gmail.com
                CC: wikidata-b...@lists.wikimedia.org
       Web browser: ---
   Mobile Platform: ---

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to