r64890 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64889‎ | r64890 | r64891 >
Date:17:33, 10 April 2010
Author:catrope
Status:deferred
Tags:
Comment:
1.16wmf4: MFT r64889
Modified paths:
  • /branches/wmf/1.16wmf4/extensions/GlobalUsage (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/GlobalUsage/SpecialGlobalUsage.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/extensions/GlobalUsage/SpecialGlobalUsage.php
@@ -226,10 +226,23 @@
227227 * @return bool
228228 */
229229 protected static function hasResults( $imagePage ) {
 230+ # Don't display links if the target file does not exist
230231 $file = $imagePage->getFile();
231 - if ( !$file->exists() || $file->getRepoName() == 'local' )
 232+ if ( !$file->exists() ) {
232233 return false;
 234+ }
233235
 236+ # Don't show global usage if the file is local.
 237+ # Do show it however if the current repo is the shared repo. The way
 238+ # we detect this is a bit hacky and less than ideal. See bug 23136 for
 239+ # a discussion.
 240+ global $wgGlobalUsageDatabase;
 241+ $dbr = wfGetDB( DB_SLAVE );
 242+ if ( $file->getRepoName() == 'local'
 243+ && $dbr->getDBname() != $wgGlobalUsageDatabase ) {
 244+ return false;
 245+ }
 246+
234247 $query = self::getImagePageQuery( $imagePage->getFile()->getTitle() );
235248 return (bool)$query->getResult();
236249 }
Property changes on: branches/wmf/1.16wmf4/extensions/GlobalUsage
___________________________________________________________________
Name: svn:mergeinfo
237250 + /branches/wmf-deployment/extensions/GlobalUsage:60970
/trunk/extensions/GlobalUsage:64889
/trunk/phase3/extensions/GlobalUsage:63545-63546,63549,63643,63764,63897-63901

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r64889(bug 23136) Regression: Section "Global usage" is not shown on Commons file page...btongminh17:18, 10 April 2010

Status & tagging log