Page MenuHomePhabricator

Access to item from talk page
Closed, ResolvedPublic

Description

I’m currently working on a Lua module (to replace wikitext, at least partly, in hu:Sablon:Cikktörténet), and it would be great if I could query the connected item (e.g. for featured articles in other languages, or to check if the badges passed as parameter match the badges stored in Wikidata). There is a function in the mw.wikibase module (client/includes/DataAccess/Scribunto/mw.wikibase.lua, around line 65) which gets the item ID based on mw.title.getCurrentTitle().prefixedText, this means for me that we could change it to content page name (since talk pages won’t have own connected items, so it won’t cause conflict).

Event Timeline

Tacsipacsi raised the priority of this task from to Needs Triage.
Tacsipacsi updated the task description. (Show Details)
Tacsipacsi added a subscriber: Tacsipacsi.
Restricted Application added a project: Wikidata. · View Herald TranscriptJan 10 2016, 5:44 PM
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald Transcript

Can you please clarify what you want? It is already possible to access the data of any item on huwiki.

Looks like T74815

Yes, in a bit "lighter" version, because we do have arbitrary access, but (as far as I know) we can't get the ID from the talk page (which is currently required to get the item).

hoo added a subscriber: hoo.EditedAug 4 2016, 2:48 PM

Somewhat related to T142093: Decide how to do usage tracking for strings used to lookup entities (page titles, external ids, …). Not sure special functionality for this is needed, or we can just go with T133498/T74815.

Esc3300 added a subscriber: Esc3300.

For projects using talk pages for maintenance templates and categories, this could be helpful.

Note that it is possible to have talk pages connected to repository if the wiki configuration allows that, and the item may be different from the one the associated page is connected to.

Restricted Application added a subscriber: PokestarFan. · View Herald TranscriptJul 25 2017, 3:12 PM
Uzume added a subscriber: Uzume.Jan 15 2018, 10:01 AM

@Tacsipacsi It sounds like you want: mw.wikibase.getEntityIdForTitle(mw.title.getCurrentTitle().subjectPageTitle.prefixedText)

Is there some reason why that does not work for you?

Tacsipacsi closed this task as Resolved.Jan 15 2018, 10:56 AM
Tacsipacsi assigned this task to Tpt.
Tacsipacsi added a subscriber: Tpt.

Nothing, except for that this function didn’t exist in August 2016, as it was added in 9394035a05fa.

Uzume removed a subscriber: Uzume.Jan 16 2018, 2:39 PM