if ( isset( $params['pages'] ) || empty( $params['recursive'] ) ) {
$ranges = array(); // sanity; this is a leaf node
+ $realBSize = 0;
wfWarn( __METHOD__ . " called on {$job->getType()} leaf job (explosive recursion)." );
} elseif ( isset( $params['range'] ) ) {
// This is a range job to trigger the insertion of partitioned/title jobs...
// Combine the first range (of size $bSize) backlinks into leaf jobs
if ( isset( $ranges[0] ) ) {
list( $start, $end ) = $ranges[0];
- $titles = $title->getBacklinkCache()->getLinks( $params['table'], $start, $end );
- foreach ( array_chunk( iterator_to_array( $titles ), $cSize ) as $titleBatch ) {
+ $iter = $title->getBacklinkCache()->getLinks( $params['table'], $start, $end );
+ $titles = iterator_to_array( $iter );
+ /** @var Title[] $titleBatch */
+ foreach ( array_chunk( $titles, $cSize ) as $titleBatch ) {
$pages = array();
foreach ( $titleBatch as $tl ) {
$pages[$tl->getArticleId()] = array( $tl->getNamespace(), $tl->getDBKey() );