Krinkle has uploaded a new change for review.

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

Change subject: content: Deprecate TitleIsCssOrJsPage and TitleIsWikitextPage 
hooks
......................................................................

content: Deprecate TitleIsCssOrJsPage and TitleIsWikitextPage hooks

They're currently documented as a 'compatibility hook'
in docs/contenthandler.txt. No longer used in any Wikimedia-hosted
git repository.

Superseded by the ContentHandlerDefaultModelFor hook.

Change-Id: I212230da7d6080cf500f930d4aa5a9024959d5f9
---
M RELEASE-NOTES-1.25
M docs/hooks.txt
M includes/Title.php
M includes/content/ContentHandler.php
4 files changed, 12 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/73/177173/1

diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25
index 92e0a2c..5d423a1 100644
--- a/RELEASE-NOTES-1.25
+++ b/RELEASE-NOTES-1.25
@@ -250,6 +250,10 @@
   fail for custom tokens registered only via the deprecated 
ApiTokensGetTokenTypes
   hook. The ApiQueryTokensRegisterTypes hook should be used for this to work.
 * Added wgRelevantArticleId to the client-side config, for use on special 
pages.
+* Deprecated the TitleIsCssOrJsPage hook. Superseded by the
+  ContentHandlerDefaultModelFor hook since MediaWiki 1.21.
+* Deprecated the TitleIsWikitextPage hook. Superseded by the
+  ContentHandlerDefaultModelFor hook since MediaWiki 1.21.
 
 == Compatibility ==
 
diff --git a/docs/hooks.txt b/docs/hooks.txt
index a4e02c6..062a0c8 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -2692,7 +2692,8 @@
 $title: The title in question.
 &$types: The types of protection available.
 
-'TitleIsCssOrJsPage': Called when determining if a page is a CSS or JS page.
+'TitleIsCssOrJsPage': DEPRECATED! Use ContentHandlerDefaultModelFor instead.
+Called when determining if a page is a CSS or JS page.
 $title: Title object that is being checked
 $result: Boolean; whether MediaWiki currently thinks this is a CSS/JS page.
   Hooks may change this value to override the return value of
@@ -2713,7 +2714,8 @@
   Hooks may change this value to override the return value of
   Title::isMovable().
 
-'TitleIsWikitextPage': Called when determining if a page is a wikitext or 
should
+'TitleIsWikitextPage': DEPRECATED! Use ContentHandlerDefaultModelFor instead.
+Called when determining if a page is a wikitext or should
 be handled by separate handler (via ArticleViewCustom).
 $title: Title object that is being checked
 $result: Boolean; whether MediaWiki currently thinks this is a wikitext page.
diff --git a/includes/Title.php b/includes/Title.php
index f913859..638da08 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -1250,9 +1250,9 @@
 
                # @note This hook is also called in 
ContentHandler::getDefaultModel.
                #   It's called here again to make sure hook functions can 
force this
-               #   method to return true even outside the mediawiki namespace.
+               #   method to return true even outside the MediaWiki namespace.
 
-               wfRunHooks( 'TitleIsCssOrJsPage', array( $this, &$isCssOrJsPage 
) );
+               wfRunHooks( 'TitleIsCssOrJsPage', array( $this, &$isCssOrJsPage 
), '1.25' );
 
                return $isCssOrJsPage;
        }
diff --git a/includes/content/ContentHandler.php 
b/includes/content/ContentHandler.php
index ac41722..9aa42dd 100644
--- a/includes/content/ContentHandler.php
+++ b/includes/content/ContentHandler.php
@@ -214,7 +214,7 @@
                }
 
                // Hook can force JS/CSS
-               wfRunHooks( 'TitleIsCssOrJsPage', array( $title, 
&$isCssOrJsPage ) );
+               wfRunHooks( 'TitleIsCssOrJsPage', array( $title, 
&$isCssOrJsPage ), '1.25' );
 
                // Is this a .css subpage of a user page?
                $isJsCssSubpage = NS_USER == $ns
@@ -229,7 +229,7 @@
                $isWikitext = $isWikitext && !$isCssOrJsPage && 
!$isJsCssSubpage;
 
                // Hook can override $isWikitext
-               wfRunHooks( 'TitleIsWikitextPage', array( $title, &$isWikitext 
) );
+               wfRunHooks( 'TitleIsWikitextPage', array( $title, &$isWikitext 
), '1.25' );
 
                if ( !$isWikitext ) {
                        switch ( $ext ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/177173
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I212230da7d6080cf500f930d4aa5a9024959d5f9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to