Skip to content
Browse files

MDL-24355 tag: added code to prevent an error if there are no tag cor…

…relations found
  • Loading branch information...
1 parent ef7383d commit ab0c861479c5effcc5325ecd5e171e6b4f62e149 @andyjdavis andyjdavis committed
Showing with 6 additions and 1 deletion.
  1. +6 −1 tag/lib.php
View
7 tag/lib.php
@@ -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).')');
+ }
}
/**

0 comments on commit ab0c861

Please sign in to comment.
Something went wrong with that request. Please try again.