Page MenuHomePhabricator

BaseTemplateAfterPortlet is replaced with SkinAfterPortlet
Closed, ResolvedPublic

Description

The BaseTemplate class is concerned with rendering. It should not be concerned with altering data. This will allow us to have alternative rendering layers e.g Mustache and eventually Vue.

For this reason, I propose the following:

  1. A Skin::getAfterPortlet method is added. This will have a hook SkinAfterPortlet which will take the same parameters as BaseTemplateAfterPortlet. getAfterPortlet calls this method.
  2. We update extensions to use the new hook instead of the old hook
  3. BaseTemplate::renderAfterPortlet and Skin::getAfterPortlet and BaseTemplateAfterPortlet are marked as deprecated
NOTE: for extensions/skins that need to support older versions they would conditionally define the BaseTemplateAfterPortlet for older versions where the new hook is not available.

Event Timeline

Jdlrobson renamed this task from BaseTemplateAfterPortlet is replaced with SkinAfterPortlet to [1.36] BaseTemplateAfterPortlet is replaced with SkinAfterPortlet.Jun 6 2020, 7:53 PM

Change 603342 had a related patch set uploaded (by Mainframe98; owner: Mainframe98):
[mediawiki/core@master] Replace BaseTemplateAfterPortlet with SkinAfterPortlet

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

Change 603632 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/UniversalLanguageSelector@master] BaseTemplateAfterPortlet is replaced with SkinAfterPortlet

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

According to https://codesearch.wmflabs.org/search/?q=BaseTemplateAfterPortlet&i=nope&files=&repos=, some skins (Cologne Blue and GreyStuff) manually call this hook. Those should be migrated as well. CodeSearch also indicates Wikibase as a user of the hook. Strangely UniversalLanguageSelector is not listed.

Strangely UniversalLanguageSelector is not listed.

That's because my patch to use it hasn't been merged yet :) It hasn't used it historically but will going forward.

Jdlrobson renamed this task from [1.36] BaseTemplateAfterPortlet is replaced with SkinAfterPortlet to BaseTemplateAfterPortlet is replaced with SkinAfterPortlet.Jun 9 2020, 3:29 PM

Change 603632 abandoned by Jdlrobson:
BaseTemplateAfterPortlet is replaced with SkinAfterPortlet

Reason:
merged into parent

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

Jdlrobson raised the priority of this task from Low to High.Jun 9 2020, 9:42 PM

Looks like we should be able to get this into 1.35

Change 603342 merged by jenkins-bot:
[mediawiki/core@master] Replace BaseTemplateAfterPortlet with SkinAfterPortlet

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