// populate this pageset with the generator output
if ( !$isDryRun ) {
$generator->executeGenerator( $this );
- Hooks::run( 'APIQueryGeneratorAfterExecute', [ &$generator, &$this ] );
+
+ // Avoid PHP 7.1 warning of passing $this by reference
+ $apiModule = $this;
+ Hooks::run( 'APIQueryGeneratorAfterExecute', [ &$generator, &$apiModule ] );
} else {
// Prevent warnings from being reported on these parameters
$main = $this->getMain();
$this->mAllPages[0][$title] = $this->mFakePageId;
$this->mInvalidTitles[$this->mFakePageId] = [
'title' => $title,
- 'invalidreason' => $ex->getMessage(),
+ 'invalidreason' => $this->getErrorFormatter()->formatException( $ex, [ 'bc' => true ] ),
];
$this->mFakePageId--;
continue; // There's nothing else we can do