Problem/Motivation

When trying to preview un-saved node with the social share buttons website crashes with the Drupal\Core\Entity\EntityMalformedException: The "node" entity cannot have a URI as it does not have an ID in Drupal\Core\Entity\EntityBase->toUrl() (line 161 of /app/web/core/lib/Drupal/Core/Entity/EntityBase.php). message in the watchdog.

Steps to reproduce

  1. Enable this module
  2. Place social share buttons on the default display
  3. go to the node create page and click Preview button

Proposed resolution

Don't crash and use website URL to render social share buttons and match expected layout

Remaining tasks

  • Patch - done
  • Review
  • Commit

User interface changes

None

API changes

None

Data model changes

None

CommentFileSizeAuthor
#2 bssb-3342256-2.patch1.04 KBrosk0

Comments

RoSk0 created an issue. See original summary.

rosk0’s picture

Assigned: rosk0 » Unassigned
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.04 KB

Proposed resolution implementation.

ericgsmith’s picture

Status: Needs review » Reviewed & tested by the community

Was able to reproduce the error following the steps outlined.

Applied patch - error is resolved.

Patch looks good and explanation in comments is thorough and explains the issue well.

Good stuff!

RTBC

  • shelane committed 20046a4e on 4.x authored by RoSk0
    Issue #3342256 by RoSk0, ericgsmith: Exception during node preview
    
shelane’s picture

Status: Reviewed & tested by the community » Fixed

I was unable to recreate the exception error, but the patch looks good to me anyhow. Thanks.

Status: Fixed » Closed (fixed)

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