Page MenuHomePhabricator

BlueSpice: SkinTemplateOutputPageBeforeExec hook is to be deprecated, use ChameleonSkinTemplateOutputPageBeforeExec
Open, Needs TriagePublic

Description

I am writing to inform you that the SkinTemplateOutputPageBeforeExec hook will soon be soft deprecated. Your code will continue to work in 1.35 however will omit warnings if your LocalSettings.php enables $wgDeprecationWarnings = true;. Note that by 1.36 the Vector skin will not support the SkinTemplateOutputPageBeforeExec hook. Please let me know if there's any issues with this timeline. These changes will help simplify and improve the skinning architecture of MediaWiki and hopefully lead to the availability of more skins.

From a casual glance it looks like most of these hooks are adding menu items.

Alternative hooks to use are documented in:
https://www.mediawiki.org/wiki/User:Jdlrobson/Skins_for_extension_developers provides guidance on the modern method

I'm happy to help provide any guidance as necessary to help you make the required changes.

Migration

  1. I proposed a new hook was added to Chameleon (ChameleonSkinTemplateOutputPageBeforeExec). Using this it should be a straightforward rename of all your existing hooks (although you may want to use this opportunity to refactor in case the hook needs to change again)

https://github.com/ProfessionalWiki/chameleon/pull/168

  1. For the 2 cases where title is modified $this->template->data['title'] .= $rating->getTag(); advice is provided on mw.org

Impacted extensions

mediawiki-extensions-BlueSpiceRating

There are 4 usages of the hook:

"\\BlueSpice\\Rating\\Hook\\SkinTemplateOutputPageBeforeExec\\AddArticleRating::callback",
253			"\\BlueSpice\\Rating\\Hook\\SkinTemplateOutputPageBeforeExec\\AddArticleLikeRating::callback",
254			"\\BlueSpice\\Rating\\Hook\\SkinTemplateOutputPageBeforeExec\\AddRating::callback",
255			"\\BlueSpice\\Rating\\Hook\\SkinTemplateOutputPageBeforeExec\\AddRecommendationsGlobalAction::callback"
256		]

BlueSpiceFoundation

Two usages of the hook

"\\BlueSpice\\Hook\\SkinTemplateOutputPageBeforeExec\\AddAdminTools::callback",
"\\BlueSpice\\Hook\\SkinTemplateOutputPageBeforeExec\\AddExportDownloadFile::callback"

BlueSpiceReminder

Two usages

BlueSpiceExpiry

one usage

BlueSpiceArticleInfo

1 usage

BlueSpiceBookshelfUI

1 usage

BlueSpiceCustomMenu

1 usage

BlueSpiceDistributionConnector

1 usage

BlueSpiceExtendedFilelist

1 usage

BlueSpiceExtendedSearch

1 usage

BlueSpiceExtendedStatistic

1 usage

BlueSpiceInsertCategory

1 usage

BlueSpicePageAssignments

1 usage

BlueSpicePrivacy

1 usage

BlueSpiceQRCode

1 usage

BlueSpiceReaders

1 usage

BlueSpiceRSSReader

1 usage

BlueSpiceSMWConnector

1 usage

BlueSpiceSocialTags

1 usage

BlueSpiceSocialTopics

1 usage

BlueSpiceSocialWikiPage

1 usage

BlueSpiceUEModulePDF

1 usage

BlueSpiceUserSidebar

1 usage

BlueSpiceWikiExplorer

1 usage

BlueSpiceUEModuleDOCX

1 usage

BlueSpiceUEModuleHTML

1 usage

BlueSpiceUEModulePDFRecursive

1 usage

BlueSpiceUEModulePDFSubpages

1 usage

Related Objects

Event Timeline

Jdlrobson renamed this task from SkinTemplateOutputPageBeforeExec hook is to be deprecated - please use to BlueSpice: SkinTemplateOutputPageBeforeExec hook is to be deprecated.Jun 2 2020, 11:44 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)Jun 18 2020, 7:28 PM
Jdlrobson added a subscriber: Mglaser.

I've sent a pull request to Chameleon which should aid this migration making it super straightforward - https://github.com/ProfessionalWiki/chameleon/pull/168

Jdlrobson renamed this task from BlueSpice: SkinTemplateOutputPageBeforeExec hook is to be deprecated to BlueSpice: SkinTemplateOutputPageBeforeExec hook is to be deprecated, use ChameleonSkinTemplateOutputPageBeforeExec.Jun 22 2020, 3:23 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a subscriber: Osnard.
Osnard added a comment.Jul 8 2020, 4:59 AM

Thanks for the PR to Chameleon. Much appreciated. Unfortunately I am not sure whether we can switch to version 3 of Chameleon soon. We will probably switch to one of the new recommended methods.

Pwirth added a subscriber: Pwirth.Jul 25 2020, 12:18 PM

Until we are able to update to the new Chameleon version we added the same hook into BlueSpiceCalumma: https://gerrit.wikimedia.org/r/c/mediawiki/skins/BlueSpiceCalumma/+/616224

I added commits for the migration from "SkinTemplateOutputPageBeforeExec" to "ChameleonSkinTemplateOutputPageBeforeExec" for all extensions
I also migrated the four hook handlers from "mediawiki-extensions-BlueSpiceRating", as the hook OutputPageBeforeHTML seems to be executed only on WikiTextContent pages

Change 627236 had a related patch set uploaded (by Pwirth; owner: Pwirth):
[mediawiki/extensions/BlueSpiceExtendedStatistics@REL1_35] Fix binding on deprecated hook

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

Change 627236 abandoned by Pwirth:
[mediawiki/extensions/BlueSpiceExtendedStatistics@REL1_35] Fix binding on deprecated hook

Reason:
Duplicate of not cherry-picked: I7ee8c52737d65a035680ac87c54fc955e91a9a7c

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