Tpt created this task. Tpt added projects: Wikidata, Wikisource. Restricted Application added a subscriber: Aklapper.
TASK DESCRIPTION To implement T128173 <https://phabricator.wikimedia.org/T128173> properly, the Wikisource extension needs to give to the Wikibase extensions new sitelinks to output in the other project sidebar. If there is no hook, the Wikisource extension would have to duplicate Wikibase logic related to language link display, prioritization of local sitelinks, badges rendering.... It seems to me that the proper way of doing it is to introduce a new hook "WikibaseClientLangLinksForItem" that would take as parameter the current `Item` (or `ItemId`?), the array of `SiteLink`s to edit and a `UsageAccumulator` for dependency tracking. The extension would be able to customize the site link list, allowing to add new links without being able to interfere with how they are rendered. This hook interface and usages seem to be easily extensible to the current use cases of the `WikibaseClientOtherProjectsSidebar` hook that allows to customize the other project sidebar. Its two users, Wikisource and WikimediaBadges, <https://codesearch.wmflabs.org/search/?q=WikibaseClientOtherProjectsSidebar&i=nope> use it only to add new links without further customization. But this hook exposes much more data on how the links are rendered. Maybe we could create a single hook `WikibaseClientLinksForItem` that would allow extensions to add new sitelinks for a given item to display in the UI, both in the other project and in the other languages sidebar (and maybe in other places in the future?). In this case the Wikibase extension would call this hook for building the two sidebars and then would care itself alone on how to render them. I just wrote a first WIP change for introducing the hook (without merging the other project sidebar hook and without unit tests): https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/553866 @Addshore what do you think about it? TASK DETAIL https://phabricator.wikimedia.org/T239546 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Tpt Cc: Aklapper, Tpt, Addshore, darthmon_wmde, MJL, DannyS712, Nandana, Lahi, Gq86, GoranSMilovanovic, Mahir256, QZanden, LawExplorer, _jensen, rosalieper, Bodhisattwa, Scott_WUaS, Samwilson, Hsarrazin, Wikidata-bugs, aude, jayvdb, Shizhao, Billinghurst, Mbch331, jayantanth, Krenair
_______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
