Steps to reproduce

  1. Enable voting up/down on a content type.
  2. Configure the Rate widget to display for this type.
  3. Try to add a new node of this type, but before clicking the Save button on the form, click Preview.

Expected results
The node preview is shown with a rate widget that is not operable (no ID to tie the votes to yet, so URL rendering breaks).

Actual results
A fatal error is issued.

Comments

kevin.dutra created an issue. See original summary.

kevin.dutra’s picture

Issue summary: View changes
mikechr’s picture

I've updated the code so when the entity_id is nonexistent the widget will render as if the user couldn't vote. Please try this patch.

mikechr’s picture

Status: Active » Needs review
vj’s picture

StatusFileSize
new3.04 KB

Confirmed #3 works. Adding one more condition in template so thumbs down link is removed.

  • kevin.dutra committed 2867448 on 8.x-1.x
    Issue #2941727 by Mikechr: Fatal error when previewing new node with...
kevin.dutra’s picture

Status: Needs review » Fixed

Thanks for the patch!

@Vj: As an FYI, for a maintainer to commit a patch, the code changes must be confined to what the issue summary describes. If a patch includes other pieces, it's not as likely to be accepted. In this case, there were other issues already in the issue queue that dealt with the changes you added and caused a conflict.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.