rating MDL-21657 updated aliasing and unaliasing of the fields returned by user_pictu...
authorAndrew Davis <andrew@affinitysoftware.net>
Thu, 18 Mar 2010 08:17:21 +0000 (08:17 +0000)
committerAndrew Davis <andrew@affinitysoftware.net>
Thu, 18 Mar 2010 08:17:21 +0000 (08:17 +0000)
rating/index.php

index 412ae8c..96ffa75 100644 (file)
@@ -78,12 +78,12 @@ if (!$ratings) {
     echo "<th class=\"header\" scope=\"col\" style=\"width:100%\"><a href=\"report.php?id=$itemid&amp;sort=rating\">$strrating</a></th>";
     echo "<th class=\"header\" scope=\"col\"><a href=\"report.php?id=$itemid&amp;sort=time\">$strtime</a></th>";
     echo "</tr>";
-    $user = null;
+
     foreach ($ratings as $rating) {
-        //undo the aliasing necessary for user_picture::fields
-        $user = clone($rating);//could get away with just overwriting rating->id and not cloning
-        //the rating object as we don't use rating->id again. That just seems like a bad idea.
-        $user->id = $user->uid;
+        //Undo the aliasing of the user id column from user_picture::fields()
+        //we could clone the rating object or preserve the rating id if we needed it again
+        //but we don't
+        $rating->id = $rating->uid;
         
         echo '<tr class="ratingitemheader">';
         echo "<td>";