r55189 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55188‎ | r55189 | r55190 >
Date:15:46, 17 August 2009
Author:werdna
Status:deferred
Tags:
Comment:
Fix bug 20095, update id/username storage when users are renamed
Modified paths:
  • /trunk/extensions/LiquidThreads/LiquidThreads.php (modified) (history)
  • /trunk/extensions/LiquidThreads/classes/Hooks.php (modified) (history)
  • /trunk/extensions/LiquidThreads/lqt.sql (modified) (history)
  • /trunk/extensions/Renameuser/SpecialRenameuser_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Renameuser/SpecialRenameuser_body.php
@@ -397,6 +397,8 @@
398398 } else {
399399 $this->tables['recentchanges'] = array('rc_user_text','rc_user');
400400 }
 401+
 402+ wfRunHooks( 'RenameUserSQL', array( $this ) );
401403 }
402404
403405 /**
Index: trunk/extensions/LiquidThreads/LiquidThreads.php
@@ -77,6 +77,9 @@
7878 // Search
7979 $wgHooks['ShowSearchHitTitle'][] = 'LqtHooks::customiseSearchResultTitle';
8080
 81+// Rename
 82+$wgHooks['RenameUserSQL'][] = 'LqtHooks::onUserRename';
 83+
8184 // Special pages
8285 $wgSpecialPages['MoveThread'] = 'SpecialMoveThread';
8386 $wgSpecialPages['NewMessages'] = 'SpecialNewMessages';
Index: trunk/extensions/LiquidThreads/classes/Hooks.php
@@ -240,4 +240,13 @@
241241
242242 return true;
243243 }
 244+
 245+ static function onUserRename( $renameUserSQL ) {
 246+ // Always use the job queue, talk page edits will take forever
 247+ $renameUserSQL->tablesJob['thread'] =
 248+ array( 'thread_author_name', 'thread_author_id', 'thread_modified' );
 249+ $renameUserSQL->tablesJob['thread_history'] =
 250+ array( 'th_user_text', 'th_user', 'th_timestamp' );
 251+ return true;
 252+ }
244253 }
Index: trunk/extensions/LiquidThreads/lqt.sql
@@ -25,7 +25,8 @@
2626 INDEX thread_article_title (thread_article_namespace, thread_article_title),
2727 INDEX thread_modified (thread_modified),
2828 INDEX thread_created (thread_created),
29 - INDEX thread_summary_page (thread_summary_page)
 29+ INDEX thread_summary_page (thread_summary_page),
 30+ INDEX (thread_author_id,thread_author_name)
3031 ) /*$wgDBTableOptions*/;
3132
3233

Status & tagging log