Page MenuHomePhabricator

default mw.wikibase.label() to the connected item of a page
Closed, ResolvedPublic1 Estimated Story Points


it would be nice if mw.wikibase.label() would default to the connected item of a page.

same for mw.wikibase.description() and mw.wikibase.sitelink()

right now, I get "Lua error: id must be of type string, nil given." error.

Event Timeline

aude raised the priority of this task from to Needs Triage.
aude updated the task description. (Show Details)
aude added a subscriber: aude.

Change 210907 had a related patch set uploaded (by Aude):
Default mw.wikibase.* lua functions to the connected item of a page

right now, a lot of modules have code like:

function getId( id )
    if not mw.wikibase then
           return "wikibase module not found"
    if id then return id end
    entity = mw.wikibase.getEntityObject()
    if not entity then return nil end

-- Returns the local page of the data item provided.
    id = getId(frame.args[1])
    if id == nil then
           return "(no element found)"
    return mw.wikibase.sitelink( id )

this would become unnecessary, and is intuiatively how I expected and thought these things worked.

Lydia_Pintscher moved this task from incoming to ready to go on the Wikidata board.
Lydia_Pintscher set Security to None.
Lydia_Pintscher added a subscriber: Lydia_Pintscher.

Change 210907 merged by jenkins-bot:
Default mw.wikibase.* lua functions to the connected item of a page

hoo removed a project: Patch-For-Review.
hoo moved this task from Review to Done on the Wikidata-Sprint-2015-05-05 board.