Mark 3 hooks deprecated by ContentHandler as such
authorReedy <reedy@wikimedia.org>
Wed, 5 Oct 2016 00:20:08 +0000 (01:20 +0100)
committerReedy <reedy@wikimedia.org>
Wed, 5 Oct 2016 23:41:14 +0000 (23:41 +0000)
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

RELEASE-NOTES-1.28
includes/EditPage.php
includes/content/ContentHandler.php
includes/diff/DifferenceEngine.php
includes/page/Article.php

index 27e02a5..1ece2a4 100644 (file)
@@ -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 ==
 
index c0c0048..c1ba3ce 100644 (file)
@@ -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 );
index d709c5c..5755918 100644 (file)
@@ -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 ) {
index 1537535..f27db07 100644 (file)
@@ -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 {
index 338b1ae..022dd94 100644 (file)
@@ -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;
                                        }