From 2fa6899f94a18c7ed676ced06427ce8c0cbf4dbe Mon Sep 17 00:00:00 2001 From: thinca Date: Fri, 31 May 2013 00:26:32 +0900 Subject: Rating::build_cache: cache the correct value The structure of the temporary $ratings array changed a while ago, but we were still trying to pull the global rating from the old structure. --- lib/class/rating.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/class/rating.class.php b/lib/class/rating.class.php index 921211df..4e32b752 100644 --- a/lib/class/rating.class.php +++ b/lib/class/rating.class.php @@ -89,7 +89,7 @@ class Rating extends database_object { while ($row = Dba::fetch_assoc($db_results)) { $ratings[$row['object_id']] = $row['rating']; - } + } foreach ($ids as $id) { // First store the user-specific rating @@ -106,7 +106,7 @@ class Rating extends database_object { $rating = 0; } else { - $rating = round($ratings[$id]['rating'], 1); + $rating = round($ratings[$id], 1); } parent::add_to_cache('rating_' . $type . '_all', $id, $rating); } -- cgit