$prefixList = $this->getNamespaceKeyAndText( $namespace, $prefix );
$namespaces = $wgContLang->getNamespaces();
$res = null;
+ $n = 0;
+ $nextRow = null;
if ( !$prefixList || !$fromList ) {
$out = $this->msg( 'allpagesbadtitle' )->parseAsBlock();
// @todo FIXME: Side link to previous
- $n = 0;
if ( $res->numRows() > 0 ) {
$out = Html::openElement( 'ul', [ 'class' => 'mw-prefixindex-list' ] );
$linkCache = MediaWikiServices::getInstance()->getLinkCache();
$prefixLength = strlen( $prefix );
foreach ( $res as $row ) {
if ( $n >= $this->maxPerPage ) {
+ $nextRow = $row;
break;
}
$title = Title::newFromRow( $row );
$topOut = $this->namespacePrefixForm( $namespace, $prefix );
- if ( $res && ( $n == $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
+ if ( $res && ( $n == $this->maxPerPage ) && $nextRow ) {
$query = [
- 'from' => $s->page_title,
+ 'from' => $nextRow->page_title,
'prefix' => $prefix,
'hideredirects' => $this->hideRedirects,
'stripprefix' => $this->stripPrefix,
$nextLink = Linker::linkKnown(
$this->getPageTitle(),
- $this->msg( 'nextpage', str_replace( '_', ' ', $s->page_title ) )->escaped(),
+ $this->msg( 'nextpage', str_replace( '_', ' ', $nextRow->page_title ) )->escaped(),
[],
$query
);