MDL-22270 ratings - avoid breackage in forum/glossary/data and inform to developer...
authorEloy Lafuente <stronk7@moodle.org>
Sat, 1 May 2010 17:45:20 +0000 (17:45 +0000)
committerEloy Lafuente <stronk7@moodle.org>
Sat, 1 May 2010 17:45:20 +0000 (17:45 +0000)
rating/lib.php

index a9ec6c7..cad1176 100644 (file)
@@ -546,6 +546,9 @@ class rating_manager {
             case RATING_AGGREGATE_SUM:
                 $aggregatestr = 'SUM';
                 break;
+            default:
+                $aggregatestr = 'AVG'; // Default to this to avoid real breakage - MDL-22270
+                debugging('Incorrect call to get_aggregation_method(), was called with incorrect aggregate method ' . $aggregate, DEBUG_DEVELOPER);
         }
         return $aggregatestr;
     }
@@ -560,4 +563,4 @@ class rating_manager {
         }
         return $pluginpermissionsarray;
     }
-}//end rating_manager class definition
\ No newline at end of file
+}//end rating_manager class definition