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 created this task.May 14 2015, 1:30 PM
aude raised the priority of this task from to Needs Triage.
aude updated the task description. (Show Details)
aude added a subscriber: aude.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 14 2015, 1:30 PM

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

aude added a comment.EditedMay 14 2015, 3:17 PM

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 triaged this task as Medium priority.May 15 2015, 1:14 PM
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.
aude claimed this task.May 18 2015, 7:33 PM
aude moved this task from Backlog to Review on the Wikidata-Sprint-2015-05-05 board.
Tobi_WMDE_SW edited a custom field.May 25 2015, 11:08 AM

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

hoo closed this task as Resolved.May 29 2015, 2:27 AM
hoo removed a project: Patch-For-Review.
hoo moved this task from Review to Done on the Wikidata-Sprint-2015-05-05 board.