r68608 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68607‎ | r68608 | r68609 >
Date:19:52, 26 June 2010
Author:mgrabovsky
Status:reverted
Tags:
Comment:
Follow-up r68606, per comments:
* Fixed use of deprecated Article::insertNewArticle and Article::updateArticle in extensions
Modified paths:
  • /trunk/extensions/DynamicPageList/DPL.php (modified) (history)
  • /trunk/extensions/Postcomment/Postcomment.php (modified) (history)
  • /trunk/extensions/SpamBlacklist/cleanup.php (modified) (history)
  • /trunk/extensions/SpamDiffTool/SpamDiffTool_body.php (modified) (history)
  • /trunk/extensions/YouTubeAuthSub/YouTubeAuthSub_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/YouTubeAuthSub/YouTubeAuthSub_body.php
@@ -56,10 +56,8 @@
5757 }
5858 }
5959 $content = "{{YoutubeVideo|{$wgRequest->getVal('id')}|{$title}|{$keywords}|{$description}|{$category}}}";
60 - $a->insertNewArticle($content,
61 - wfMsg('youtubeauthsub_summary'),
62 - false,
63 - false);
 60+ $a->doEdit( $content, wfMsg('youtubeauthsub_summary'), EDIT_NEW
 61+ | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY, false, null, false, false, '', true );
6462 $wgOut->redirect('');
6563 }
6664 $wgOut->addWikiText(wfMsg('youtubeauthsub_viewpage', $descTitle->getFullText()) );
Index: trunk/extensions/SpamDiffTool/SpamDiffTool_body.php
@@ -55,13 +55,15 @@
5656 if ( $wgUser->getID() > 0 )
5757 $watch = $wgUser->isWatched( $sb );
5858 if ( $insert ) {
59 - $a->insertNewArticle( $text, wfMsgForContent( 'spamdifftool_summary' ), false, $watch );
 59+ $a->doEdit( $text, wfMsgForContent( 'spamdifftool_summary' ), EDIT_NEW
 60+ | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY, false, null, $watch, false, '', true );
6061 } else {
61 - $a->updateArticle( $text, wfMsgForContent( 'spamdifftool_summary' ), false, $watch );
 62+ $a->doEdit( $text, wfMsgForContent( 'spamdifftool_summary' ), EDIT_UPDATE
 63+ | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY, false, null, $watch, false, '', true );
6264 }
6365 $returnto = $wgRequest->getVal( 'returnto' );
6466 if ( $returnto != null && $returnto != '' )
65 - $wgOut->redirect( $wgScript . "?" . urldecode( $returnto ) ); // clear the redirect set by updateArticle
 67+ $wgOut->redirect( $wgScript . "?" . urldecode( $returnto ) ); // clear the redirect set by doEdit
6668 return;
6769 }
6870 $vals = $wgRequest->getValues();
Index: trunk/extensions/SpamBlacklist/cleanup.php
@@ -36,6 +36,7 @@
3737 }
3838 $dbw = wfGetDB( DB_MASTER );
3939 $dbw->immediateBegin();
 40+ $article = new Article( $title );
4041 if ( !$rev ) {
4142 // Didn't find a non-spammy revision, delete the page
4243 /*
@@ -45,14 +46,14 @@
4647 */
4748 // Too scary, blank instead
4849 print "All revisions are spam, blanking...\n";
49 - $article = new Article( $title );
50 - $article->updateArticle( '', "All revisions matched the spam blacklist ($match), blanking",
51 - false, false );
 50+ $article->doEdit( '', "All revisions matched the spam blacklist ($match), blanking",
 51+ EDIT_UPDATE | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY, false, null, false, false,
 52+ '', true );
5253
5354 } else {
5455 // Revert to this revision
55 - $article = new Article( $title );
56 - $article->updateArticle( $rev->getText(), "Cleaning up links to $match", false, false );
 56+ $article->doEdit( $rev->getText(), "Cleaning up links to $match", EDIT_UPDATE
 57+ | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY, false, null, false, false, '', true );
5758 }
5859 $dbw->immediateCommit();
5960 wfDoUpdates();
Index: trunk/extensions/Postcomment/Postcomment.php
@@ -194,9 +194,11 @@
195195
196196 if ($update) {
197197 //echo "trying to update article";
198 - $article->updateArticle($text, "", true, $watch);
 198+ $article->doEdit( $text, '', EDIT_UPDATE | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY
 199+ | EDIT_MINOR, false, null, $watch, false, '', true );
199200 } else {
200201 //echo "inserting new article";
201 - $article->insertNewArticle($text, "", true, $watch, false, false, true);
 202+ $article->doEdit( $text, $summary, EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY
 203+ | EDIT_MINOR | EDIT_FORCE_BOT, false, null, $watch, false, '', true );
202204 }
203205 }
Index: trunk/extensions/DynamicPageList/DPL.php
@@ -1138,7 +1138,8 @@
11391139 $wgArticle = $articleX = new Article( $titleX );
11401140 $permission_errors = $articleX->mTitle->getUserPermissionsErrors( 'edit', $wgUser );
11411141 if ( count( $permission_errors ) == 0 ) {
1142 - $articleX->updateArticle( $text, $summary, false, $titleX->userIsWatching() );
 1142+ $articleX->doEdit( $text, $summary, EDIT_UPDATE | EDIT_DEFER_UPDATES
 1143+ | EDIT_AUTOSUMMARY, false, null, $titleX->userIsWatching(), false, '', true );
11431144 return '';
11441145 } else {
11451146 $wgOut->showPermissionsErrorPage( $permission_errors );

Follow-up revisions

RevisionCommit summaryAuthorDate
r70760* Revert r66878, completely misses the point of factoring out doEdit() in the...tstarling08:33, 9 August 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r68606(bug 18891) Deprecated Article::insertNewArticle still used in coremgrabovsky13:25, 26 June 2010

Status & tagging log