From: scyrma <scyrma>
Date: Mon, 23 Jun 2008 04:31:41 +0000 (+0000)
Subject: MDL-15345: prevent problem while running tag_compute_correlations under pgsql. (merge... 
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=eafa83ef9d5f8b82a0097ccf8c83f5f45050bb84;p=moodle.git

MDL-15345: prevent problem while running tag_compute_correlations under pgsql. (merge from 1.9)
---

diff --git a/tag/lib.php b/tag/lib.php
index 5450d821fe..14c9a26efc 100644
--- a/tag/lib.php
+++ b/tag/lib.php
@@ -786,7 +786,7 @@ function tag_compute_correlations($min_correlation=2) {
                    WHERE ta.tagid = ? AND tb.tagid <> ?
                 GROUP BY tb.tagid
                   HAVING nr > ?
-                ORDER BY nr DESC";
+                ORDER BY COUNT(*) DESC";
         $params = array($tag->id, $tag->id, $min_correlation);
 
         $correlated = array();