r89547 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89546‎ | r89547 | r89548 >
Date:00:32, 6 June 2011
Author:krinkle
Status:ok (Comments)
Tags:
Comment:
Use tokens where needed for WatchAction (as of r89545)
* ./MultilingualLiquidThreads/LiquidThreads/classes/Thread.php
* ./extensions/LiquidThreads/classes/Thread.php
* ./extensions/MetavidWiki/includes/articlepages/MV_DataPage.php
** MV_DataPage.php: Per r86041 I replaced the second watch-call in MV_DataPage.php with an unwatch call.
* ./extensions/ReplaceText/ReplaceTextJob.php
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/Thread.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/articlepages/MV_DataPage.php (modified) (history)
  • /trunk/extensions/MultilingualLiquidThreads/LiquidThreads/classes/Thread.php (modified) (history)
  • /trunk/extensions/ReplaceText/ReplaceTextJob.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/Thread.php
@@ -112,7 +112,7 @@
113113 NewMessages::writeMessageStateForUpdatedThread( $thread, $change_type, $wgUser );
114114
115115 if ( $wgUser->getOption( 'lqt-watch-threads', false ) ) {
116 - Action::factory( 'watch', $thread->topmostThread()->root() )->execute();
 116+ WatchAction:doWatch( $thread->topmostThread()->root()->getTitle(), $wgUser );
117117 }
118118
119119 return $thread;
Index: trunk/extensions/MultilingualLiquidThreads/LiquidThreads/classes/Thread.php
@@ -113,7 +113,7 @@
114114 NewMessages::writeMessageStateForUpdatedThread( $thread, $change_type, $wgUser );
115115
116116 if ( $wgUser->getOption( 'lqt-watch-threads', false ) ) {
117 - Action::factory( 'watch', $thread->topmostThread()->root() )->execute();
 117+ WatchAction:doWatch( $thread->topmostThread()->root()->getTitle(), $wgUser );
118118 }
119119
120120 return $thread;
@@ -1095,7 +1095,7 @@
10961096 }
10971097
10981098 // The 'root' is the page in the Thread namespace corresponding to this thread.
1099 - function root( ) {
 1099+ function root() {
11001100 if ( !$this->rootId ) return null;
11011101 if ( !$this->root ) {
11021102 if ( isset( self::$articleCacheById[$this->rootId] ) ) {
Index: trunk/extensions/MetavidWiki/includes/articlepages/MV_DataPage.php
@@ -63,9 +63,9 @@
6464 if ( $confirm ) {
6565 $this->doDelete( $reason );
6666 if ( $wgRequest->getCheck( 'wpWatch' ) ) {
67 - Action::factory( 'watch', $this )->execute();
 67+ WatchAction:doWatch( $this->mTitle, $wgUser );
6868 } elseif ( $this->mTitle->userIsWatching() ) {
69 - Action::factory( 'watch', $this )->execute();
 69+ WatchAction:doUnwatch( $this->mTitle, $wgUser );
7070 }
7171 return;
7272 }
Index: trunk/extensions/ReplaceText/ReplaceTextJob.php
@@ -42,7 +42,7 @@
4343 $create_redirect = $this->params['create_redirect'];
4444 $this->title->moveTo( $new_title, true, $reason, $create_redirect );
4545 if ( $this->params['watch_page'] ) {
46 - Action::factory( 'watch', new Article( $new_title, 0 ) )->execute();
 46+ WatchAction::doWatch( $new_title, $wgUser );
4747 }
4848 $wgUser = $actual_user;
4949 } else {

Follow-up revisions

RevisionCommit summaryAuthorDate
r89554Fix syntax errors from r89547reedy09:43, 6 June 2011
r89569Follow-up to r89547 - re-added compatibility with MW < 1.9yaron15:15, 6 June 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86041r86001, now with less scariness :P I took out the delete action and did purg...happy-melon10:38, 14 April 2011
r89545WatchAction requires token (BREAKING CHANGE)...krinkle00:09, 6 June 2011

Comments

#Comment by Nikerabbit (talk | contribs)   06:49, 6 June 2011

Now you introduced new syntax terrors the kind you fixed in previous commit.

WatchAction:doUnwatch( $this->mTitle, $wgUser );
#Comment by Krinkle (talk | contribs)   09:11, 6 June 2011

Yikes, copy/paste failure. Will fix as soon as I get back home (or someone else who feels like doing it)

Status & tagging log