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.

CommentFileSizeAuthor
#2 3233387-2.patch1.79 KBcantrellnm

Comments

cantrellnm created an issue. See original summary.

cantrellnm’s picture

StatusFileSize
new1.79 KB
mohit.bansal623’s picture

Status: Active » Needs review

Is there anything needs to do here, I can see the patch already uploaded.

cantrellnm’s picture

Just needs review, I think? It's a pretty small change.

jeroent’s picture

ivnish’s picture

Status: Needs review » Closed (won't fix)