From: Aryeh Gregor Date: Thu, 20 Mar 2008 17:33:32 +0000 (+0000) Subject: (bug 13454) Article::updateCategoryCounts can attempt to execute empty inserts. X-Git-Tag: 1.31.0-rc.0~48928 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=5b8efa96d4d08631ceda9ef2a1c82f4660b09803;p=lhc%2Fweb%2Fwiklou.git (bug 13454) Article::updateCategoryCounts can attempt to execute empty inserts. --- diff --git a/includes/Article.php b/includes/Article.php index 10ff07574a..4404625ba2 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -3367,6 +3367,10 @@ class Article { # # Sometimes I wish we had INSERT ... ON DUPLICATE KEY UPDATE. $insertCats = array_merge( $added, $deleted ); + if( !$insertCats ) { + # Okay, nothing to do + return; + } $insertRows = array(); foreach( $insertCats as $cat ) { $insertRows[] = array( 'cat_title' => $cat );