Foxtrott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/113466

Change subject: bugfix: target name wrong or empty
......................................................................

bugfix: target name wrong or empty

Autoedit API uses the 'title' parameter as target name if no specific target 
name is provided. This is alright for normal autoedit functionality, but when 
used from a job.
Solution: Explicitly set the target name to ''.

Change-Id: I95879699909c9f47433fa070d0d2111ab92fa711
---
M includes/SPSPageCreationJob.php
1 file changed, 8 insertions(+), 7 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticPageSeries 
refs/changes/66/113466/1

diff --git a/includes/SPSPageCreationJob.php b/includes/SPSPageCreationJob.php
index 1a8c95d..345a5a0 100644
--- a/includes/SPSPageCreationJob.php
+++ b/includes/SPSPageCreationJob.php
@@ -2,7 +2,7 @@
 
 /**
  * File holding the SPSPageCreationJob class
- * 
+ *
  * @author Stephan Gambke
  * @file
  * @ingroup SemanticPageSeries
@@ -27,16 +27,17 @@
         * @return boolean success
         */
        function run() {
-               
+
                global $wgUser, $wgCommandLineMode;
-               
+
                $oldUser = $wgUser;
                $wgUser = User::newFromId( $this->params['user'] );
 
                unset( $this->params['user'] );
-               
+
                $this->params['form'] = $this->title->getText();
-               
+               $this->params['target'] = '';
+
                $handler = new SFAutoeditAPI( new ApiMain(), 'sfautoedit' );
 
                // TODO: Method is removed in SF 2.5 onwards. Remove the whole 
if-clause
@@ -44,7 +45,7 @@
                if ( method_exists( $handler, 'isApiQuery' ) ) {
                        $handler->isApiQuery( false );
                }
-               
+
                $handler->setOptions( $this->params );
 
                // TODO: Method storeSemanticData is removed in SF 2.5 onwards. 
Clean this up
@@ -74,7 +75,7 @@
                wfDebugLog( 'sps', 'Page Creation Job: ' . $result );
 
                $wgUser = $oldUser;
-               
+
        }
 
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/113466
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I95879699909c9f47433fa070d0d2111ab92fa711
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticPageSeries
Gerrit-Branch: master
Gerrit-Owner: Foxtrott <s7ep...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to