recipes ratings are broken

Started by ilya.makedon

ilya.makedon Lv 1

The votes don't seem to work at all any more. When I go to a recipe page (for example recipe/2052) and click on the starts "vote saved" message briefly appears followed by the display of my rating. When I refresh the page "no votes yet" appears instead of my rating.

ilya.makedon Lv 1

The problems was that the voting api cache was not getting recalculated. When the user submitted the vote it was stored in the vote api table but not propagated to the cache table. However, when page is loaded, voting information is read from the cache table.

To resolve the problem I changed the voting api settings to recalculate the stats for the content after every vote. I also wrote a module called votecalc that recomputed all the votes for all the content. Somehow all the old votes in the voting api table never got calculated into the cache.

This also fixed the strange behavior of the the voting in the feedback pages.