r112775 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112774‎ | r112775 | r112776 >
Date:05:32, 1 March 2012
Author:saper
Status:ok (Comments)
Tags:
Comment:
Fix bug 34838 for Extension:Collection when posting book to a wikipage

FauxRequest replaced with DerivativeRequest for editing
Modified paths:
  • /trunk/extensions/Collection/Collection.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/Collection.body.php
@@ -814,7 +814,7 @@
815815 * @return bool
816816 */
817817 function saveCollection( $title, $forceOverwrite = false ) {
818 - global $wgUser;
 818+ global $wgRequest, $wgUser;
819819
820820 $article = new Article( $title );
821821 if ( $article->exists() && !$forceOverwrite ) {
@@ -861,12 +861,14 @@
862862 }
863863 }
864864
865 - $req = new FauxRequest( array(
866 - 'action' => 'edit',
867 - 'title' => $title->getPrefixedText(),
868 - 'text' => $articleText,
869 - 'token' => $wgUser->editToken(),
870 - ), true, $_SESSION );
 865+ $req = new DerivativeRequest(
 866+ $wgRequest,
 867+ array(
 868+ 'action' => 'edit',
 869+ 'title' => $title->getPrefixedText(),
 870+ 'text' => $articleText,
 871+ 'token' => $wgUser->editToken(),
 872+ ), true);
871873 $api = new ApiMain( $req, true );
872874 $api->execute();
873875 return true;

Follow-up revisions

RevisionCommit summaryAuthorDate
r112848MFT r112770, r112771, r112772, r112775reedy23:03, 1 March 2012
r113037MFT r110703, r110933, r111011, r111218, r112520, r112524, r112660, r112687, r...reedy14:59, 5 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112770Fix bug 34838 when a response to Moodbar feedback is posted...saper04:14, 1 March 2012

Comments

#Comment by Aaron Schulz (talk | contribs)   05:44, 1 March 2012
+ ), true);

Whitespace is a little funny, like the last fix.

#Comment by MaxSem (talk | contribs)   10:11, 1 March 2012

Why not WikiPage::doEdit()?

Status & tagging log