Deleting Ratings

Affected version


Short: Deleting a Rating-Comment does not delete the rating itself.

How to reproduce:
1) Leave a star-rating on a media item with a comment.
2) Delete (soft or hard) that comment with the rating from that media item. (through /media/comments/xx/delete)
3) The rating_avg and and rating_count does not update after rebuilding caches through xf-rebuild:xfmg-media-items.

The issue at hand is not a cache issue. After deleting the comment the actual rating is still present in xf_mg_rating. Hard deleting that rating from the database and flushing the caches creates the desired outcome.

It seems like the _postDelete hook in the Rating Entity is never called.