Fix exception in ApiPageSet
[lhc/web/wiklou.git] / includes / api / ApiPageSet.php
index 9fdad2b..b05cb2b 100644 (file)
@@ -152,7 +152,6 @@ class ApiPageSet extends ApiBase {
                        if ( !$isDryRun ) {
                                $generator->executeGenerator( $this );
                                wfRunHooks( 'APIQueryGeneratorAfterExecute', array( &$generator, &$this ) );
-                               $this->resolvePendingRedirects();
                        } else {
                                // Prevent warnings from being reported on these parameters
                                $main = $this->getMain();
@@ -163,6 +162,10 @@ class ApiPageSet extends ApiBase {
                        $generator->profileOut();
                        $this->profileIn();
 
+                       if ( !$isDryRun ) {
+                               $this->resolvePendingRedirects();
+                       }
+
                        if ( !$isQuery ) {
                                // If this pageset is not part of the query, we called profileIn() above
                                $dbSource->profileOut();