MDL-54620 ratings: display '0' when aggregate = 0

This commit is contained in:
Kevin Wiliarty
2016-05-18 07:21:28 +08:00
committed by David Monllao
parent 33892edf18
commit 393890e168
+1 -1
View File
@@ -224,7 +224,7 @@ class rating implements renderable {
// Only display aggregate if aggregation method isn't COUNT.
$aggregatestr = '';
if ($aggregate && $method != RATING_AGGREGATE_COUNT) {
if (is_numeric($aggregate) && $method != RATING_AGGREGATE_COUNT) {
if ($method != RATING_AGGREGATE_SUM && !$this->settings->scale->isnumeric) {
// Round aggregate as we're using it as an index.