jenkins-bot has submitted this change and it was merged.

Change subject: Remove CustomData extension dependency
......................................................................


Remove CustomData extension dependency

The related pages stored via CustomData  will have been migrated to the
cached ParserOutput class over the last 30 days, per I30bd17f, so all
interactions with/references to CustomData can be removed.

Bug: T115019
Change-Id: I36919d2443f0ee02ac6baf9a4d2228b028b2e6ed
---
M includes/Hooks.php
1 file changed, 1 insertion(+), 33 deletions(-)

Approvals:
  Bmansurov: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Hooks.php b/includes/Hooks.php
index c83c95a..714df5a 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -3,8 +3,6 @@
 namespace RelatedArticles;
 
 use Parser;
-// FIXME: Remove in 30 days (T114915)
-use CustomData;
 use Exception;
 use Title;
 use SkinTemplate;
@@ -84,36 +82,12 @@
                return true;
        }
 
-
-       /**
-       * Gets the global instance of the {@see CustomData} class for backwards 
compatibility.
-       *
-       * FIXME: This can be removed when cache clears. (T114915)
-       * If the instance isn't available, then an exception is thrown.
-       *
-       * @throws Exception When the CustomData extension isn't properly 
installed
-       * @deprecated
-       * @return CustomData
-       */
-       public static function getCustomData() {
-               global $wgCustomData;
-
-               if ( !$wgCustomData instanceof CustomData ) {
-                       throw new Exception(
-                               'CustomData extension isn\'t properly installed 
and is needed to view pages in cache.'
-                       );
-               }
-
-               return $wgCustomData;
-       }
-
        /**
         * Passes the related articles list from the cached parser output
         * object to the output page for rendering.
         *
         * The list of related articles will be retrieved using
-        * <code>ParserOutput#getExtensionData</code> and, if that fails,
-        * <code>CustomData#getParserData</code>.
+        * <code>ParserOutput#getExtensionData</code>.
         *
         * @param OutputPage $out
         * @param ParserOutput $parserOutput
@@ -121,12 +95,6 @@
         */
        public static function onOutputPageParserOutput( OutputPage &$out, 
ParserOutput $parserOutput ) {
                $related = $parserOutput->getExtensionData( 'RelatedArticles' );
-               // Backwards compatability with old cached pages. In cached 
pages, related articles will not be in
-               // ParserOutput but will still be in custom data so let's 
retrieve them from there.
-               // FIXME: Remove in 30 days (T114915)
-               if ( !$related ) {
-                       $related = self::getCustomData()->getParserData( $out, 
'RelatedArticles' );
-               }
 
                if ( $related ) {
                        $out->setProperty( 'RelatedArticles', $related );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I36919d2443f0ee02ac6baf9a4d2228b028b2e6ed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RelatedArticles
Gerrit-Branch: dev
Gerrit-Owner: Phuedx <[email protected]>
Gerrit-Reviewer: Bmansurov <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to