Mark 3 hooks deprecated by ContentHandler as such
ArticleViewCustom, EditPageGetDiffText and EditPageGetPreviewText hooks now marked as deprecated in 1.21. TitleIsCssOrJsPage and TitleIsWikitextPage deprecation version dropped from 1.25 to 1.21 to match other hooks. Bug: T145728 Bug: T147382 Bug: T147383 Bug: T147384 Bug: T147385 Bug: T147386 Change-Id: I59b6b9f253857eb1040dad879a71e0d8cf141553
This commit is contained in:
parent
34587fa3b2
commit
dee0d1ce4e
5 changed files with 16 additions and 8 deletions
|
|
@ -214,6 +214,8 @@ changes to languages because of Phabricator reports.
|
|||
* IP::isConfiguredProxy() and IP::isTrustedProxy() were removed. Callers should
|
||||
migrate to using the same functions on a ProxyLookup instance, obtainable from
|
||||
MediaWikiServices.
|
||||
* The ArticleViewCustom, EditPageGetDiffText and EditPageGetPreviewText hooks will
|
||||
now emit deprecation warnings if used.
|
||||
|
||||
== Compatibility ==
|
||||
|
||||
|
|
|
|||
|
|
@ -3416,7 +3416,7 @@ HTML
|
|||
}
|
||||
|
||||
if ( $newContent ) {
|
||||
ContentHandler::runLegacyHooks( 'EditPageGetDiffText', [ $this, &$newContent ] );
|
||||
ContentHandler::runLegacyHooks( 'EditPageGetDiffText', [ $this, &$newContent ], '1.21' );
|
||||
Hooks::run( 'EditPageGetDiffContent', [ $this, &$newContent ] );
|
||||
|
||||
$popts = ParserOptions::newFromUserAndLang( $wgUser, $wgContLang );
|
||||
|
|
@ -3829,7 +3829,7 @@ HTML
|
|||
}
|
||||
|
||||
$hook_args = [ $this, &$content ];
|
||||
ContentHandler::runLegacyHooks( 'EditPageGetPreviewText', $hook_args );
|
||||
ContentHandler::runLegacyHooks( 'EditPageGetPreviewText', $hook_args, '1.25' );
|
||||
Hooks::run( 'EditPageGetPreviewContent', $hook_args );
|
||||
|
||||
$parserResult = $this->doPreviewParse( $content );
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ abstract class ContentHandler {
|
|||
}
|
||||
|
||||
// Hook can force JS/CSS
|
||||
Hooks::run( 'TitleIsCssOrJsPage', [ $title, &$isCodePage ], '1.25' );
|
||||
Hooks::run( 'TitleIsCssOrJsPage', [ $title, &$isCodePage ], '1.21' );
|
||||
|
||||
// Is this a user subpage containing code?
|
||||
$isCodeSubpage = NS_USER == $ns
|
||||
|
|
@ -258,7 +258,7 @@ abstract class ContentHandler {
|
|||
$isWikitext = $isWikitext && !$isCodePage && !$isCodeSubpage;
|
||||
|
||||
// Hook can override $isWikitext
|
||||
Hooks::run( 'TitleIsWikitextPage', [ $title, &$isWikitext ], '1.25' );
|
||||
Hooks::run( 'TitleIsWikitextPage', [ $title, &$isWikitext ], '1.21' );
|
||||
|
||||
if ( !$isWikitext ) {
|
||||
switch ( $ext ) {
|
||||
|
|
|
|||
|
|
@ -620,7 +620,11 @@ class DifferenceEngine extends ContextSource {
|
|||
}
|
||||
} elseif ( !Hooks::run( 'ArticleContentViewCustom', [ $this->mNewContent, $this->mNewPage, $out ] ) ) {
|
||||
// Handled by extension
|
||||
} elseif ( !ContentHandler::runLegacyHooks( 'ArticleViewCustom', [ $this->mNewContent, $this->mNewPage, $out ] ) ) {
|
||||
} elseif ( !ContentHandler::runLegacyHooks(
|
||||
'ArticleViewCustom',
|
||||
[ $this->mNewContent, $this->mNewPage, $out ],
|
||||
'1.21'
|
||||
) ) {
|
||||
// NOTE: deprecated hook, B/C only
|
||||
// Handled by extension
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -623,9 +623,11 @@ class Article implements Page {
|
|||
|
||||
# Allow extensions do their own custom view for certain pages
|
||||
$outputDone = true;
|
||||
} elseif ( !ContentHandler::runLegacyHooks( 'ArticleViewCustom',
|
||||
[ $this->fetchContentObject(), $this->getTitle(), $outputPage ] ) ) {
|
||||
|
||||
} elseif ( !ContentHandler::runLegacyHooks(
|
||||
'ArticleViewCustom',
|
||||
[ $this->fetchContentObject(), $this->getTitle(), $outputPage ],
|
||||
'1.21'
|
||||
) ) {
|
||||
# Allow extensions do their own custom view for certain pages
|
||||
$outputDone = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue