Last modified: 2014-11-19 17:58:12 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T75615, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 73615 - mw.entity.label and mw.wikibase.sitelink are expected to return nil
mw.entity.label and mw.wikibase.sitelink are expected to return nil
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataClient (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Wikidata bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-19 17:14 UTC by Aude
Modified: 2014-11-19 17:58 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Aude 2014-11-19 17:14:44 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
Comment 1 Gerrit Notification Bot 2014-11-19 17:16:26 UTC
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
Comment 2 Aude 2014-11-19 17:18:21 UTC
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.
Comment 3 Gerrit Notification Bot 2014-11-19 17:29:26 UTC
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
Comment 4 Gerrit Notification Bot 2014-11-19 17:32:34 UTC
Change 174443 merged by jenkins-bot:
Return nil when mw.entity.label and sitelink don't find anything

https://gerrit.wikimedia.org/r/174443
Comment 5 Gerrit Notification Bot 2014-11-19 17:46:08 UTC
Change 174445 merged by jenkins-bot:
Return nil when mw.entity.label and sitelink don't find anything

https://gerrit.wikimedia.org/r/174445

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links