MDL-24803 fixed tagid typo in tag correlation table update

This commit is contained in:
Petr Skoda 2010-10-23 10:26:38 +00:00
parent b3e387ec3a
commit aced917bae

View 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);