Ajax error on IEF The 'node' entity cannot have a URI as it does not have an ID

Created on 16 February 2019, almost 6 years ago
Updated 5 February 2024, 10 months ago

This is a more obscure case, but it's happening to me:

When adding a node that uses share_everywhere in an Inline Entity Form, the node may not yet have a URL but may be rendered in a preview view mode. This triggers an ajax error and the node cannot be saved:

The 'node' entity cannot have a URI as it does not have an ID in Drupal\Core\Entity\Entity->toUrl() (line 189 of core/lib/Drupal/Core/Entity/Entity.php). share_everywhere_node_view(Array, Object, Object, 'inline_preview'

We need to ensure that the node is not new before attempting to retrieve an id or url.
if (!$node->isNew()) {

πŸ› Bug report
Status

RTBC

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States brooke_heaton

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024