r83114 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83113‎ | r83114 | r83115 >
Date:21:06, 2 March 2011
Author:btongminh
Status:ok
Tags:
Comment:
Revert r69907, r69908, r70264, r70296: introduces bug 27477.
The previous situation is not very nice and this should be fixed properly, but is not so much of a priority it did work before. There are some long discussions on CR about this if anybody is interested in fixing this.
Modified paths:
  • /trunk/phase3/includes/filerepo/File.php (modified) (history)
  • /trunk/phase3/includes/filerepo/ForeignDBFile.php (modified) (history)
  • /trunk/phase3/includes/filerepo/LocalFile.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/File.php
@@ -1122,23 +1122,8 @@
11231123
11241124 /**
11251125 * Get the HTML text of the description page, if available
1126 - * For local files ImagePage does not use it, because it skips the parser cache.
11271126 */
11281127 function getDescriptionText() {
1129 - if( $this->isLocal() ) {
1130 - global $wgParser;
1131 - $revision = Revision::newFromTitle( $this->title );
1132 - if ( !$revision ) {
1133 - return false;
1134 - }
1135 - $text = $revision->getText();
1136 - if ( !$text ) {
1137 - return false;
1138 - }
1139 - $pout = $wgParser->parse( $text, $this->title, new ParserOptions() );
1140 - return $pout->getText();
1141 - }
1142 -
11431128 global $wgMemc, $wgLang;
11441129 if ( !$this->repo->fetchDescription ) {
11451130 return false;
Index: trunk/phase3/includes/filerepo/LocalFile.php
@@ -1217,9 +1217,28 @@
12181218 /** scaleHeight inherited */
12191219 /** getImageSize inherited */
12201220
1221 - /** getDescriptionUrl inherited */
1222 - /** getDescriptionText inherited */
 1221+ /**
 1222+ * Get the URL of the file description page.
 1223+ */
 1224+ function getDescriptionUrl() {
 1225+ return $this->title->getLocalUrl();
 1226+ }
12231227
 1228+ /**
 1229+ * Get the HTML text of the description page
 1230+ * This is not used by ImagePage for local files, since (among other things)
 1231+ * it skips the parser cache.
 1232+ */
 1233+ function getDescriptionText() {
 1234+ global $wgParser;
 1235+ $revision = Revision::newFromTitle( $this->title );
 1236+ if ( !$revision ) return false;
 1237+ $text = $revision->getText();
 1238+ if ( !$text ) return false;
 1239+ $pout = $wgParser->parse( $text, $this->title, new ParserOptions() );
 1240+ return $pout->getText();
 1241+ }
 1242+
12241243 function getDescription() {
12251244 $this->load();
12261245 return $this->description;
Index: trunk/phase3/includes/filerepo/ForeignDBFile.php
@@ -44,4 +44,14 @@
4545 function move( $target ) {
4646 $this->readOnlyError();
4747 }
 48+
 49+ function getDescriptionUrl() {
 50+ // Restore remote behaviour
 51+ return File::getDescriptionUrl();
 52+ }
 53+
 54+ function getDescriptionText() {
 55+ // Restore remote behaviour
 56+ return File::getDescriptionText();
 57+ }
4858 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r831541.17wmf1: MFT r82836, r82853, r82858, r83114catrope18:19, 3 March 2011
r85354MFT r82518, r82530, r82538, r82547, r82550, r82565, r82572, r82608, r82696, r...demon18:25, 4 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r69907Pass $this->getName() to getLocalUrlreedy20:55, 25 July 2010
r69908File:: to parent::reedy20:56, 25 July 2010
r70264Revert r69907reedy08:49, 1 August 2010
r70296Repair getDescriptionUrl() and getDescriptionText() Follow up to r69907 and r......hartman22:07, 1 August 2010

Status & tagging log