Page MenuHomePhabricator

Access to item from talk page
Closed, ResolvedPublic


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 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).

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.

@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 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.