VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Quality & Testing VirtueMart 1.1.x => Virtuemart 1.1 Development (Archiv) => Q&T Resolved => Topic started by: Dave Withnall on September 14, 2009, 15:03:57 PM

Title: Vote edits increment vote count
Post by: Dave Withnall on September 14, 2009, 15:03:57 PM
Howdy,

I just noticed that if you edit a rating it will automatically increment the vote count & appends the vote to the list.
EG. If a product has 1 review of rating 3 and you then edit the review and update the vote to a 5 the product will now store 3 & 5  with a total score of 4 (rather than 5).
This behaviour, in my opinion, is incorrect as an edit is not a new vote.

I have created a patch for ps_reviews.php which alters the behaviour. With this patch an edit will remove an old vote and replace it with a new one and scores will be calculated based on the new vote list.

Regards,

Dave.


[attachment cleanup by admin]
Title: Re: Vote edits increment vote count
Post by: aravot on September 21, 2009, 21:19:09 PM
Fixed in 1.1.4, thank you.
Title: Re: Vote edits increment vote count
Post by: aravot on September 24, 2009, 22:59:46 PM
The code generates the following error.

QuoteNotice: Undefined variable: votes_arr in /home/site/administrator/components/com_virtuemart/classes/ps_reviews.php on line 219

Warning: array_search() [function.array-search]: Wrong datatype for second argument in /home/site/administrator/components/com_virtuemart/classes/ps_reviews.php on line 219

Notice: Undefined variable: votes_arr in /home/site/administrator/components/com_virtuemart/classes/ps_reviews.php on line 220