MDL-24355 tag: added code to prevent an error if there are no tag correlations found

This commit is contained in:
Andrew Davis (andyjdavis)
2011-06-07 17:06:00 +08:00
parent ef7383d32a
commit ab0c861479
+6 -1
View File
@@ -824,7 +824,12 @@ function tag_compute_correlations($mincorrelation = 2) {
rs_close($rs);
// Remove any correlations that weren't just identified
delete_records_select('tag_correlation', 'id NOT IN ('.join(',', $correlations).')');
if (empty($correlations)) {
//there are no correlations so delete any in the database
delete_records('tag_correlation');
} else {
delete_records_select('tag_correlation', 'id NOT IN ('.join(',', $correlations).')');
}
}
/**