MDL-24803 fixed tagid typo in tag correlation table update
authorPetr Skoda <skodak@moodle.org>
Sat, 23 Oct 2010 10:26:38 +0000 (10:26 +0000)
committerPetr Skoda <skodak@moodle.org>
Sat, 23 Oct 2010 10:26:38 +0000 (10:26 +0000)
tag/lib.php

index c9702da..9f84a0b 100644 (file)
@@ -854,10 +854,11 @@ function tag_compute_correlations($min_correlation=2) {
         //var_dump($correlated);
 
         //saves correlation info in the caching table
-        if ($tag_correlation_obj = $DB->get_record('tag_correlation', array('tagid'=>$tag->id), 'tagid')) {
+        if ($tag_correlation_obj = $DB->get_record('tag_correlation', array('tagid'=>$tag->id), 'id')) {
             $tag_correlation_obj->correlatedtags = $correlated;
             $DB->update_record('tag_correlation', $tag_correlation_obj);
         } else {
+            $tag_correlation_obj = new stdClass();
             $tag_correlation_obj->tagid          = $tag->id;
             $tag_correlation_obj->correlatedtags = $correlated;
             $DB->insert_record('tag_correlation', $tag_correlation_obj);