r68144 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68143‎ | r68144 | r68145 >
Date:02:24, 17 June 2010
Author:tisane
Status:deferred
Tags:
Comment:
Fix glitch in interwiki watch/unwatch
Modified paths:
  • /trunk/extensions/InterwikiIntegration/InterwikiIntegration.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/InterwikiIntegration/InterwikiIntegration.hooks.php
@@ -350,6 +350,7 @@
351351 * Add newly watched articles to integration_watchlist
352352 */
353353 public static function InterwikiIntegrationWatchArticleComplete( &$user, &$article ) {
 354+ global $wgDBname;
354355 $title = $article->getTitle();
355356 if ( $title->isTalkPage () ) {
356357 $subjectNamespace = $title->getSubjectPage()->getNamespace();
@@ -362,17 +363,17 @@
363364 $dbw = wfGetDB( DB_MASTER );
364365 $dbw->insert( 'integration_watchlist',
365366 array(
366 - 'integration_wl_user' => $user->id,
 367+ 'integration_wl_user' => $user->getId(),
 368+ 'integration_wl_db' => $wgDBname,
367369 'integration_wl_namespace' => $subjectNamespace,
368 - 'integration_wl_title' => $DBkey,
369 - 'integration_wl_notificationtimestamp' => null
 370+ 'integration_wl_title' => $DBkey
370371 ) );
371372 $dbw->insert( 'integration_watchlist',
372373 array(
373 - 'integration_wl_user' => $this->id,
 374+ 'integration_wl_user' => $user->getId(),
 375+ 'integration_wl_db' => $wgDBname,
374376 'integration_wl_namespace' => $talkNamespace,
375 - 'integration_wl_title' => $DBkey,
376 - 'integration_wl_notificationtimestamp' => null
 377+ 'integration_wl_title' => $DBkey
377378 ) );
378379 return true;
379380 }
@@ -381,6 +382,7 @@
382383 * Remove newly unwatched articles from integration_watchlist
383384 */
384385 public static function InterwikiIntegrationUnwatchArticleComplete ( &$user, &$article ) {
 386+ global $wgDBname;
385387 $title = $article->getTitle();
386388 if ( $title->isTalkPage () ) {
387389 $subjectNamespace = $title->getSubjectPage()->getNamespace();
@@ -393,13 +395,15 @@
394396 $dbw = wfGetDB( DB_MASTER );
395397 $dbw->delete( 'integration_watchlist',
396398 array(
397 - 'integration_wl_user' => $user->id,
 399+ 'integration_wl_user' => $user->getId(),
 400+ 'integration_wl_db' => $wgDBname,
398401 'integration_wl_namespace' => $subjectNamespace,
399402 'integration_wl_title' => $DBkey
400403 ) );
401 - $dbw->insert( 'integration_watchlist',
 404+ $dbw->delete( 'integration_watchlist',
402405 array(
403 - 'integration_wl_user' => $this->id,
 406+ 'integration_wl_user' => $user->getId(),
 407+ 'integration_wl_db' => $wgDBname,
404408 'integration_wl_namespace' => $talkNamespace,
405409 'integration_wl_title' => $DBkey
406410 ) );

Status & tagging log