Problem/Motivation
On the 8.x-1.x branch, for the rate.vote and rate.undo_vote routes there's a 500 error if the entity doesn't exist.
Error: Call to a member function bundle() on null in Drupal\rate\RateVote->vote() (line 112 of /app/web/modules/contrib/rate/src/RateVote.php)
It's not likely users will stumble into this accidentally, but Google Search Console noticed after some nodes were deleted.
Steps to reproduce
Go to /rate/node/[ID]/updown/-1/yesno or similar where the [ID] is for a node that doesn't exist.
Proposed resolution
A 404 error should be thrown instead.
Comments
Comment #2
cantrellnm commentedComment #3
mohit.bansal623 commentedIs there anything needs to do here, I can see the patch already uploaded.
Comment #4
cantrellnm commentedJust needs review, I think? It's a pretty small change.
Comment #5
jeroentthis issue is fixed in the latest versions of 8.x-2.x and 3.0.x.
#3245074: Visiting /node/{node}/node-rating results in a 500 error when rate is not configured for the given node.
Comment #6
ivnish