r86128 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86127‎ | r86128 | r86129 >
Date:18:35, 15 April 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
follow up to r86101; fetchRow cannot just be replaced like fetchObject :)
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_Utils.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_Utils.php
@@ -92,7 +92,7 @@
9393 $res = $db->select( $db->tableName( 'categorylinks' ),
9494 'distinct cl_to', $conditions, __METHOD__ );
9595 if ( $db->numRows( $res ) > 0 ) {
96 - foreach ( $res as $row ) {
 96+ while ( $row = $db->fetchRow( $res ) ) {
9797 $categories[] = $row[0];
9898 }
9999 }
@@ -314,7 +314,7 @@
315315 __METHOD__,
316316 array( 'ORDER BY' => 'page_title' ) );
317317 $form_names = array();
318 - foreach ( $res as $row ) {
 318+ while ( $row = $db->fetchRow( $res ) ) {
319319 $form_names[] = str_replace( '_', ' ', $row[0] );
320320 }
321321 $dbr->freeResult( $res );
@@ -484,7 +484,7 @@
485485 'page_title',
486486 $conditions, __METHOD__,
487487 array( 'ORDER BY' => 'page_title' ) );
488 - foreach ( $res as $row ) {
 488+ while ( $row = $db->fetchRow( $res ) ) {
489489 $cur_value = str_replace( '_', ' ', $row[0] );
490490 if ( $substring == null ) {
491491 $pages[] = $cur_value;

Follow-up revisions

RevisionCommit summaryAuthorDate
r86129follow up to r86128; fixed cp errorjeroendedauw18:37, 15 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86101Strict, while to foreach...reedy23:35, 14 April 2011