Albert221 has uploaded a new change for review.
https://gerrit.wikimedia.org/r/258173
Change subject: Deleted mContent field
......................................................................
Deleted mContent field
mContent field is no longer used. fetchContent() now returns content from
WikiPage::getContent().
Change-Id: If94ab44a3fdd54699bcdebcd3f52f15c68d261ff
---
M includes/page/Article.php
1 file changed, 5 insertions(+), 26 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/73/258173/1
diff --git a/includes/page/Article.php b/includes/page/Article.php
index 35621a4..47b5556 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -42,18 +42,12 @@
public $mParserOptions;
/**
- * @var string Text of the revision we are working on
- * @todo BC cruft
- */
- public $mContent;
-
- /**
* @var Content Content of the revision we are working on
* @since 1.21
*/
public $mContentObject;
- /** @var bool Is the content ($mContent) already loaded? */
+ /** @var bool Is the content ($mContentObject) already loaded? */
public $mContentLoaded = false;
/** @var int|null The oldid of the article that is to be shown, 0 for
the current revision */
@@ -334,31 +328,17 @@
* @deprecated since 1.21, use WikiPage::getContent() instead
*/
function fetchContent() {
- // BC cruft!
+ $content = $this->mPage->getContent(Revision::FOR_THIS_USER,
$this->getContext()->getUser());
- ContentHandler::deprecated( __METHOD__, '1.21' );
+ ContentHandler::runLegacyHooks('ArticleAfterFetchContent',
array( &$this, &$content ));
- if ( $this->mContentLoaded && $this->mContent ) {
- return $this->mContent;
- }
-
- $content = $this->fetchContentObject();
-
- if ( !$content ) {
- return false;
- }
-
- // @todo Get rid of mContent everywhere!
- $this->mContent = ContentHandler::getContentText( $content );
- ContentHandler::runLegacyHooks( 'ArticleAfterFetchContent',
array( &$this, &$this->mContent ) );
-
- return $this->mContent;
+ return (is_null($content)) ? false : $content;
}
/**
* Get text content object
* Does *NOT* follow redirects.
- * @todo When is this null?
+ * Returns null when user doesn't have ability to view this revision.
*
* @note Code that wants to retrieve page content from the database
should
* use WikiPage::getContent().
@@ -373,7 +353,6 @@
}
$this->mContentLoaded = true;
- $this->mContent = null;
$oldid = $this->getOldID();
--
To view, visit https://gerrit.wikimedia.org/r/258173
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If94ab44a3fdd54699bcdebcd3f52f15c68d261ff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Albert221 <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits