svn commit: r953294 - /ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r953294 - /ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java

jleroux@apache.org
Author: jleroux
Date: Thu Jun 10 12:10:24 2010
New Revision: 953294

URL: http://svn.apache.org/viewvc?rev=953294&view=rev
Log:
A patch from Sumit Pandit "Average product rating is not calculated properly." (https://issues.apache.org/jira/browse/OFBIZ-3816) - OFBIZ-3816

In ProductWorker.java, method getAverageProductRating is used to calculate product's average rating. It is always return zero.

Modified:
    ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java?rev=953294&r1=953293&r2=953294&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java Thu Jun 10 12:10:24 2010
@@ -648,7 +648,7 @@ public class ProductWorker {
                     BigDecimal rating = productReview.getBigDecimal("productRating");
                     if (rating != null) {
                         ratingTally = ratingTally.add(rating);
-                        numRatings.add(BigDecimal.ONE);
+                        numRatings = numRatings.add(BigDecimal.ONE);
                     }
                 }
             }