Page MenuHomePhabricator

Update the method Wikibase uses to inject edit language links into the language portlet
Closed, ResolvedPublic

Description

SkinTemplateOutputPageBeforeExec and BaseTemplateAfterPortlet will be deprecated as part of the existing work on Vector as Vector is dropping use of the BaseTemplate altogether.

The use case in Wikibase is a legitimate one, but is currently not done in an obvious way, which led to the recent regression in T252800.

Currently Wikidata uses these two hook for two things (see code reference )

  1. Add this link at the end of the languages portal:
  2. to enable the languages portal on pages which do not have any language links, however

Link:

Proposed solution

The link should be added using SkinAfterPortlet hook. This hook can do the work done by the two hooks. But note that for the second case, Wikibase will no longer force creation of the section. (It does so now by claiming there are languages, even though there are not).

The correct thing to do, and what Wikibase will do now is to just add ( the edit action string) to the 'lang' portlet, this will alerts skin to display the section, although ultimately it's upto skins to show it or not.

Event Timeline

Restricted Application removed a project: Patch-For-Review. · View Herald TranscriptMay 14 2020, 10:16 PM

Change 596522 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/core@master] BaseTemplate: language_urls property should always reflect emptiness

https://gerrit.wikimedia.org/r/596522

Change 596518 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/Wikibase@master] Drop "display language portal" hack

https://gerrit.wikimedia.org/r/596518

Jdlrobson renamed this task from Update the method Wikibase injected edit language links into the language portal to Update the method Wikibase uses to inject edit language links into the language portal.May 14 2020, 10:23 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)May 19 2020, 11:35 PM
Jdlrobson added a project: Wikidata.

I need support from one of the Wikidata maintainers to make this change. Right now I am targeting the 1.35 release for deprecating this change. Your help meeting that goal is appreciated!

@Addshore does the above sound sane?
I can't get wikibase setup locally, so I'm going to need a lot of hand holding and support to get this change.

Jdlrobson removed Jdlrobson as the assignee of this task.May 29 2020, 2:21 AM

Change 596522 abandoned by Jdlrobson:
BaseTemplate: language_urls property should always reflect true emptiness

Reason:
Okay, I'm going to move this decision into the skins themselves. It seems like the path of least resistance right now.

https://gerrit.wikimedia.org/r/596522

Change 601483 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/MonoBook@master] Show after portal links when languages is empty.

https://gerrit.wikimedia.org/r/601483

Change 601483 merged by jenkins-bot:
[mediawiki/skins/MonoBook@master] Show after portal links when languages is empty

https://gerrit.wikimedia.org/r/601483

Change 596518 abandoned by Jdlrobson:
WIP: SkinTemplateOutputPageBeforeExecHandler is deprecated

Reason:
I can't get wikibase setup locally right now, but just to note - I do need to get a fix for this in for the July release branch cut!

https://gerrit.wikimedia.org/r/596518

Ladsgroup added a subscriber: Ladsgroup.

I'm removing wikidata tag as currently there's nothing for the team to review. Re-add the tag if we can review any patch.

Ammarpad changed the task status from Open to Stalled.Jun 6 2020, 5:57 AM
Ammarpad assigned this task to Jdlrobson.
Ammarpad removed a project: Patch-For-Review.
Ammarpad added a subscriber: Ammarpad.

Waiting for response from @Jdlrobson. The suggested replacement is itself being deprecated (T253809), so this cannot proceed.

@Ammarpad that hook will be deprecated in 1.36. It is fine for 1.35

Jdlrobson changed the task status from Stalled to Open.Jun 6 2020, 6:41 PM
Ammarpad removed Jdlrobson as the assignee of this task.Jun 6 2020, 9:54 PM

OK noted.

Change 603543 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/extensions/Wikibase@master] WIP: Wikibase should use only BaseTemplateAfterPortlet hook to add languages action links

https://gerrit.wikimedia.org/r/603543

Jdlrobson updated the task description. (Show Details)Jun 9 2020, 10:25 PM

@Ammarpad , BaseTemplateAfterPortal has now been deprecated for SkinAfterPortlet so we should use that now (in turned out to be easier to deprecate that then I first thought).

Jdlrobson moved this task from Inbox to OKR Backlog on the User-Jdlrobson board.Jun 9 2020, 11:33 PM
Jdlrobson moved this task from OKR Backlog to Blocked on the User-Jdlrobson board.

@Ammarpad , BaseTemplateAfterPortal has now been deprecated for SkinAfterPortlet so we should use that now (in turned out to be easier to deprecate that then I first thought).

OK, I updated the patch and is now ready for review.

Ammarpad updated the task description. (Show Details)Jun 10 2020, 12:26 PM
Ammarpad updated the task description. (Show Details)Jun 10 2020, 12:37 PM

Verified the above patch on Monobook, Vector and the link shows on all Wikimedia deployed skins when there are or are not languages.
Here's Vector:


Change 603543 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] WikibaseClient: Use SkinAfterPortlet hook to add languages action links

https://gerrit.wikimedia.org/r/603543

Jdlrobson closed this task as Resolved.Jun 11 2020, 9:22 PM
Krinkle renamed this task from Update the method Wikibase uses to inject edit language links into the language portal to Update the method Wikibase uses to inject edit language links into the language portlet.Jun 11 2020, 10:16 PM