Have a look at this code here .. The case "or if we store zero" is not catched with the if-condition {{if(vote Unable to render embedded object: File (= 0)}}. Thus for a 0-vote the else branch will be called. That however will remove the rating, *if* isZeroStored is configured. I thought it should rather remove, if *) not found.*isZeroStored !? I think, the following code would be correct:
if (vote != 0 || this.ratingsConfiguration.isZeroStored()) {
result = new DefaultRating(oldRating)
.setUpdatedAt(new Date())
.setVote(vote);
event = new UpdatedRatingEvent(result, oldRating.getVote());
} else {
this.removeRating(oldRating.getId());
}
Then, the if-Block catches three cases (either of vote != 0 or isZeroStored or both are true) and the else-Block catches the left over case (vote == 0 and !isZeroStored) |