jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/326171 )

Change subject: Replaced "Article::fetchContent()" deprecated in MediaWiki 1.21
......................................................................


Replaced "Article::fetchContent()" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage", and removed unused "$article" return

Bug: T151973
Change-Id: I8fa86d90863bcbede6fc0e8cddcf5a797c706e5f
---
M WikilogComment.php
M WikilogFeed.php
M WikilogItemPager.php
M WikilogUtils.php
4 files changed, 15 insertions(+), 16 deletions(-)

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



diff --git a/WikilogComment.php b/WikilogComment.php
index 41caceb..6bbc783 100644
--- a/WikilogComment.php
+++ b/WikilogComment.php
@@ -611,7 +611,7 @@
                        $html = $this->formatCommentHeader( $comment, $params );
 
                        if ( $comment->mID && $comment->mCommentRev ) {
-                               list( $article, $parserOutput ) = 
WikilogUtils::parsedArticle( $comment->mCommentTitle );
+                               $parserOutput = WikilogUtils::parsedPage( 
$comment->mCommentTitle );
                                $text = $parserOutput->getText();
                        } else {
                                $text = $comment->getText();
diff --git a/WikilogFeed.php b/WikilogFeed.php
index e4ba128..2e65d40 100644
--- a/WikilogFeed.php
+++ b/WikilogFeed.php
@@ -542,8 +542,8 @@
                $itemName = str_replace( '_', ' ', $row->wlp_title );
                $itemTitle =& Title::makeTitle( $row->page_namespace, 
$row->page_title );
 
-               # Retrieve article parser output
-               list( $article, $parserOutput ) = WikilogUtils::parsedArticle( 
$itemTitle, true );
+               # Retrieve page parser output
+               $parserOutput = WikilogUtils::parsedPage( $itemTitle, true );
 
                # Generate some fixed bits
                $authors = unserialize( $row->wlp_authors );
@@ -795,7 +795,7 @@
 
                # Comment text.
                if ( $comment->mCommentRev ) {
-                       list( $article, $parserOutput ) = 
WikilogUtils::parsedArticle( $comment->mCommentTitle, true );
+                       $parserOutput = WikilogUtils::parsedPage( 
$comment->mCommentTitle, true );
                        $content = Sanitizer::removeHTMLcomments( 
$parserOutput->getText() );
                        if ( $content ) {
                                $entry->setContent( new WlTextConstruct( 
'html', $content ) );
diff --git a/WikilogItemPager.php b/WikilogItemPager.php
index fee1849..1341bd4 100644
--- a/WikilogItemPager.php
+++ b/WikilogItemPager.php
@@ -149,7 +149,7 @@
 
                # Retrieve article parser output and other data.
                $item = WikilogItem::newFromRow( $row );
-               list( $article, $parserOutput ) = WikilogUtils::parsedArticle( 
$item->mTitle );
+               $parserOutput = WikilogUtils::parsedPage( $item->mTitle );
                list( $summary, $content ) = WikilogUtils::splitSummaryContent( 
$parserOutput );
 
                # Retrieve the common header and footer parameters.
@@ -322,7 +322,7 @@
 
                # Retrieve article parser output and other data.
                $item = WikilogItem::newFromRow( $row );
-               list( $article, $parserOutput ) = WikilogUtils::parsedArticle( 
$item->mTitle );
+               $parserOutput = WikilogUtils::parsedPage( $item->mTitle );
                list( $summary, $content ) = WikilogUtils::splitSummaryContent( 
$parserOutput );
                if ( empty( $summary ) ) {
                        $summary = $content;
diff --git a/WikilogUtils.php b/WikilogUtils.php
index 5801ec6..cc03590 100644
--- a/WikilogUtils.php
+++ b/WikilogUtils.php
@@ -39,9 +39,9 @@
         * Retrieves an article parsed output either from parser cache or by
         * parsing it again. If parsing again, stores it back into parser cache.
         *
-        * @param $title Article title object.
+        * @param $title Title Page title object
         * @param $feed Whether the result should be part of a feed.
-        * @return Two-element array containing the article and its parser 
output.
+        * @return ParserOutput Page's parser output.
         *
         * @note Mw1.16+ provides Article::getParserOptions() and
         *   Article::getParserOutput(), that could be used here in the future.
@@ -67,12 +67,12 @@
 
                static $parser = null;
 
-               $article = new Article( $title );
+               $page = WikiPage::factory( $title );
 
                # First try the parser cache.
                $useParserCache = $wgEnableParserCache &&
                        intval( $wgUser->getOption( 'stubthreshold' ) ) == 0 &&
-                       $article->exists();
+                       $page->exists();
                $parserCache = ParserCache::singleton();
 
                # Parser options.
@@ -88,11 +88,11 @@
 
                if ( $useParserCache ) {
                        # Look for the parsed article output in the parser 
cache.
-                       $parserOutput = $parserCache->get( $article, $parserOpt 
);
+                       $parserOutput = $parserCache->get( $page, $parserOpt );
 
                        # On success, return the object retrieved from the 
cache.
                        if ( $parserOutput ) {
-                               return array( $article, $parserOutput );
+                               return $parserOutput;
                        }
                }
 
@@ -117,12 +117,11 @@
                $parser->startExternalParse( $title, $parserOpt, 
Parser::OT_HTML );
 
                # Parse article.
-               $arttext = $article->fetchContent();
-               $parserOutput = $parser->parse( $arttext, $title, $parserOpt );
+               $parserOutput = $parser->parse( 
$page->getContent()->getNativeData(), $title, $parserOpt );
 
                # Save in parser cache.
                if ( $useParserCache && $parserOutput->getCacheTime() != -1 ) {
-                       $parserCache->save( $parserOutput, $article, $parserOpt 
);
+                       $parserCache->save( $parserOutput, $page, $parserOpt );
                }
 
                # Restore default behavior.
@@ -131,7 +130,7 @@
                        WikilogParser::expandLocalUrls( $saveExpUrls );
                }
 
-               return array( $article, $parserOutput );
+               return $parserOutput;
        }
 
        /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8fa86d90863bcbede6fc0e8cddcf5a797c706e5f
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/extensions/Wikilog
Gerrit-Branch: master
Gerrit-Owner: Filip <r...@protonmail.com>
Gerrit-Reviewer: Filip <r...@protonmail.com>
Gerrit-Reviewer: Reedy <re...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to