Make more ContentHandler replaced hooks emit deprecation warnings
authorReedy <reedy@wikimedia.org>
Thu, 6 Oct 2016 13:44:00 +0000 (14:44 +0100)
committerJforrester <jforrester@wikimedia.org>
Thu, 6 Oct 2016 22:50:26 +0000 (22:50 +0000)
ArticleAfterFetchContent, ArticleSave

Bug: T145728
Bug: T147387
Bug: T147389
Change-Id: I58a0c46b95b8ef02ff55851cfdec7e9d6eeed83c

RELEASE-NOTES-1.28
includes/EditPage.php
includes/page/Article.php
includes/page/WikiPage.php

index ba5c689..0078399 100644 (file)
@@ -214,8 +214,9 @@ 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, EditPageGetPreviewText and ShowRawCssJs
-  hooks will now emit deprecation warnings if used.
+* The ArticleAfterFetchContent, ArticleSave, ArticleViewCustom, EditPageGetDiffText,
+  EditPageGetPreviewText and ShowRawCssJs hooks will now emit deprecation warnings if
+  used.
 
 == Compatibility ==
 
index c1ba3ce..8ca7105 100644 (file)
@@ -1613,8 +1613,8 @@ class EditPage {
        protected function runPostMergeFilters( Content $content, Status $status, User $user ) {
                // Run old style post-section-merge edit filter
                if ( !ContentHandler::runLegacyHooks( 'EditFilterMerged',
-                       [ $this, $content, &$this->hookError, $this->summary ] )
-               ) {
+                       [ $this, $content, &$this->hookError, $this->summary ]
+               ) {
                        # Error messages etc. could be handled within the hook...
                        $status->fatal( 'hookaborted' );
                        $status->value = self::AS_HOOK_ERROR;
index 4fdbdea..9428609 100644 (file)
@@ -347,7 +347,11 @@ class Article implements Page {
 
                // @todo Get rid of mContent everywhere!
                $this->mContent = ContentHandler::getContentText( $content );
-               ContentHandler::runLegacyHooks( 'ArticleAfterFetchContent', [ &$this, &$this->mContent ] );
+               ContentHandler::runLegacyHooks(
+                       'ArticleAfterFetchContent',
+                       [ &$this, &$this->mContent ],
+                       '1.21'
+               );
 
                return $this->mContent;
        }
@@ -424,7 +428,11 @@ class Article implements Page {
                $this->mContentObject = $content;
                $this->mRevIdFetched = $this->mRevision->getId();
 
-               Hooks::run( 'ArticleAfterFetchContentObject', [ &$this, &$this->mContentObject ] );
+               ContentHandler::runLegacyHooks(
+                       'ArticleAfterFetchContentObject',
+                       [ &$this, &$this->mContentObject ],
+                       '1.21'
+               );
 
                return $this->mContentObject;
        }
index 98428dd..6c85070 100644 (file)
@@ -1678,7 +1678,7 @@ class WikiPage implements Page, IDBAccessObject {
                                                        $flags & EDIT_MINOR, null, null, &$flags, &$hookStatus ];
                // Check if the hook rejected the attempted save
                if ( !Hooks::run( 'PageContentSave', $hook_args )
-                       || !ContentHandler::runLegacyHooks( 'ArticleSave', $hook_args )
+                       || !ContentHandler::runLegacyHooks( 'ArticleSave', $hook_args, '1.21' )
                ) {
                        if ( $hookStatus->isOK() ) {
                                // Hook returned false but didn't call fatal(); use generic message