r89569 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89568‎ | r89569 | r89570 >
Date:15:15, 6 June 2011
Author:yaron
Status:resolved (Comments)
Tags:
Comment:
Follow-up to r89547 - re-added compatibility with MW < 1.9
Modified paths:
  • /trunk/extensions/ReplaceText/ReplaceTextJob.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ReplaceText/ReplaceTextJob.php
@@ -42,7 +42,12 @@
4343 $create_redirect = $this->params['create_redirect'];
4444 $this->title->moveTo( $new_title, true, $reason, $create_redirect );
4545 if ( $this->params['watch_page'] ) {
46 - WatchAction::doWatch( $new_title, $wgUser );
 46+ if ( class_exists( 'WatchAction' ) ) {
 47+ // Class was added in MW 1.19
 48+ WatchAction::doWatch( $new_title, $wgUser );
 49+ } else {
 50+ Action::factory( 'watch', new Article( $new_title, 0 ) )->execute();
 51+ }
4752 }
4853 $wgUser = $actual_user;
4954 } else {

Follow-up revisions

RevisionCommit summaryAuthorDate
r90098Follow-up to r86041 and r89569 - re-added backwards compatibility with MW < 1.18yaron23:24, 14 June 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89547Use tokens where needed for WatchAction (as of r89545)...krinkle00:32, 6 June 2011

Comments

#Comment by Nikerabbit (talk | contribs)   15:36, 6 June 2011

1.8 would be pretty old :)

#Comment by Yaron Koren (talk | contribs)   15:42, 6 June 2011

Exactly, that was my thinking. :P I meant 1.19, of course, in case anyone was confused. :)

#Comment by 😂 (talk | contribs)   23:10, 14 June 2011

Wasn't Action only added in 1.18 anyway, meaning this won't work with 1.17 and below?

#Comment by Yaron Koren (talk | contribs)   23:16, 14 June 2011

Ooh, you're right! I didn't even notice the previous set of revisions to this code. Thanks for pointing that out.

Status & tagging log