Problem/Motivation

In a view shows different amount with the same average result. For example: One article shows 4 Stars with an average rating of 4.7, another shows 5 stars with an average rating of 4.6

I use the Rate Module + Voting API

Steps to reproduce

Just different entries form a content type

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

lmaero created an issue.

drupalbubb’s picture

I think you need to explain your situation more precise with more details.
Rate module was too faulty for me, i switched to fivestar, but this is incomplete. Before deinstallation check #3453492: Deinstallation deletes system roles
Can this be a Rate issue? Who calculates the numbers?

sircosta’s picture

Hi!

We also notice inconsistent results in VotingAPI Views Integration.

Test environment:

• Drupal Core: 10.5.x
• Fivestar Module: 8.x-1.0-alpha5
• VotingAPI Module: 8.x-3.0-beta5

Objective:

Evaluate the functionality of the VotingAPI module, used in conjunction with Fivestar, to record, calculate, and display voting results using a standard Drupal View based on a content type with a rating field.

Steps Taken:

1. Module Setup:

• Installed and enabled Fivestar and its dependencies, including VotingAPI.
• Added a Fivestar rating field to a custom content type.
• Submitted multiple votes on various nodes, as authenticated users.

2. Database Verification:

• Verified via drush sqlc that vote records were correctly saved in the database.
• Observed valid entries in the vote table, including:

vote ID
vote values (e.g., 100 for 5 stars)
source identifiers
user references
timestamp information

• This confirms that VotingAPI is storing votes properly.

3. View Configuration:

• Created a standard View displaying nodes.
• Added a field to display the rating results.
• Tested the following display formats for the rating field:
• “As Star” format (provided by Fivestar) — works correctly:
Displays the star widget accurately.
Shows vote count and average rating correctly (e.g. “Average: 4.9 (7 votes)”).
• Other formats such as Average, Sum, Percent, etc. (provided by VotingAPI):
Show inconsistent or incorrect results.
In some cases, nodes with different vote counts and values show identical averages.
In other cases, the averages shown in Views do not match the actual values stored in the database.

Conclusion:

• While Fivestar correctly stores and displays vote values, the VotingAPI Views integration currently yields unreliable results in its beta version (8.x-3.0-beta5).
• The vote data in the database is valid and complete, but the Views handlers provided by VotingAPI do not accurately reflect that data.
• The “As Star” formatter from Fivestar appears reliable, but other VotingAPI-based formatters are not consistent with the actual vote records.