r61534 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61533‎ | r61534 | r61535 >
Date:20:28, 26 January 2010
Author:catrope
Status:ok
Tags:
Comment:
wmf-deployment: Merge r61395 (GlobalUsage SQL error fix) from trunk
Modified paths:
  • /branches/wmf-deployment/extensions/GlobalUsage (modified) (history)
  • /branches/wmf-deployment/extensions/GlobalUsage/GlobalUsage.php (modified) (history)
  • /branches/wmf-deployment/extensions/GlobalUsage/GlobalUsageHooks.php (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/extensions/GlobalUsage/GlobalUsageHooks.php
@@ -49,14 +49,22 @@
5050 /**
5151 * Hook to ArticleDeleteComplete
5252 * Deletes entries from usage table.
53 - * In case of an image, copies the local link table to the global.
5453 */
5554 public static function onArticleDeleteComplete( $article, $user, $reason, $id ) {
5655 $title = $article->getTitle();
5756 $gu = self::getGlobalUsage();
5857 $gu->deleteLinksFromPage( $id );
59 - if ( $title->getNamespace() == NS_FILE ) {
60 - $gu->copyLocalImagelinks( $title );
 58+
 59+ return true;
 60+ }
 61+ /**
 62+ * Hook to FileDeleteComplete
 63+ * Copies the local link table to the global.
 64+ */
 65+ public static function onFileDeleteComplete( $file, $oldimage, $article, $wgUser, $reason ) {
 66+ if ( !$oldimage ) {
 67+ $gu = self::getGlobalUsage();
 68+ $gu->copyLocalImagelinks( $file->getTitle() );
6169 }
6270 return true;
6371 }
Index: branches/wmf-deployment/extensions/GlobalUsage/GlobalUsage.php
@@ -65,6 +65,7 @@
6666 */
6767 $wgHooks['LinksUpdateComplete'][] = 'GlobalUsageHooks::onLinksUpdateComplete';
6868 $wgHooks['ArticleDeleteComplete'][] = 'GlobalUsageHooks::onArticleDeleteComplete';
 69+$wgHooks['FileDeleteComplete'][] = 'GlobalUsageHooks::onFileDeleteComplete';
6970 $wgHooks['FileUndeleteComplete'][] = 'GlobalUsageHooks::onFileUndeleteComplete';
7071 $wgHooks['UploadComplete'][] = 'GlobalUsageHooks::onUploadComplete';
7172 $wgHooks['TitleMoveComplete'][] = 'GlobalUsageHooks::onTitleMoveComplete';
Property changes on: branches/wmf-deployment/extensions/GlobalUsage
___________________________________________________________________
Name: svn:mergeinfo
7273 - /branches/REL1_15/phase3/extensions/GlobalUsage:51646
/trunk/extensions/GlobalUsage:56207,56209,56296,56333,56355,58660-60688
/trunk/phase3/extensions/GlobalUsage:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816
7374 + /branches/REL1_15/phase3/extensions/GlobalUsage:51646
/trunk/extensions/GlobalUsage:56207,56209,56296,56333,56355,58660-60688,61395
/trunk/phase3/extensions/GlobalUsage:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r61395(bug 22228) SQL error of Global Usage when image page without associated imag...btongminh21:23, 22 January 2010

Status & tagging log