https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112775
Revision: 112775
Author: saper
Date: 2012-03-01 05:32:43 +0000 (Thu, 01 Mar 2012)
Log Message:
-----------
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: trunk/extensions/Collection/Collection.body.php
===================================================================
--- trunk/extensions/Collection/Collection.body.php 2012-03-01 05:32:05 UTC
(rev 112774)
+++ trunk/extensions/Collection/Collection.body.php 2012-03-01 05:32:43 UTC
(rev 112775)
@@ -814,7 +814,7 @@
* @return bool
*/
function saveCollection( $title, $forceOverwrite = false ) {
- global $wgUser;
+ global $wgRequest, $wgUser;
$article = new Article( $title );
if ( $article->exists() && !$forceOverwrite ) {
@@ -861,12 +861,14 @@
}
}
- $req = new FauxRequest( array(
- 'action' => 'edit',
- 'title' => $title->getPrefixedText(),
- 'text' => $articleText,
- 'token' => $wgUser->editToken(),
- ), true, $_SESSION );
+ $req = new DerivativeRequest(
+ $wgRequest,
+ array(
+ 'action' => 'edit',
+ 'title' => $title->getPrefixedText(),
+ 'text' => $articleText,
+ 'token' => $wgUser->editToken(),
+ ), true);
$api = new ApiMain( $req, true );
$api->execute();
return true;
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs