Deleting a vote does not recalculate vote entity

Created on 7 March 2022, almost 3 years ago
Updated 26 January 2025, about 18 hours ago

Problem/Motivation

When you delete a vote (the vote entity itself, not the entity where votes are attached to) the vote result on that entity should be recalculated (or afterwards on cron).

For example an entity has 2 votes (1 of 10/10 and one 0/10). When we delete the 0/10 vote the average is still 5 and not / never recalculated. (Unless a new vote is added to that entity).

Steps to reproduce

Create entity with average results.
Add 2 votes with different values
Delete one vote
See average not adjusted unless a new vote is added (and cron has run).

Proposed resolution

A vote_delete hook should be added to recalculate vote results on the same entity when a vote on an entity is deleted.

πŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium mallezie Loenhout

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024