r32275 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32274‎ | r32275 | r32276 >
Date:01:10, 21 March 2008
Author:greg
Status:old
Tags:
Comment:
Don't attempt to insert if there are no rows.
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -3375,7 +3375,8 @@
33763376 foreach( $insertCats as $cat ) {
33773377 $insertRows[] = array( 'cat_title' => $cat );
33783378 }
3379 - $dbw->insert( 'category', $insertRows, __METHOD__, 'IGNORE' );
 3379+ if ( count( $insertRows ) )
 3380+ $dbw->insert( 'category', $insertRows, __METHOD__, 'IGNORE' );
33803381
33813382 $addFields = array( 'cat_pages = cat_pages + 1' );
33823383 $removeFields = array( 'cat_pages = cat_pages - 1' );

Status & tagging log