Allow new entities to be rendered

Created on 10 January 2024, 6 months ago
Updated 8 April 2024, 3 months ago

Problem/Motivation

Normally, there are parts of the entities that cannot berendered (like the URL) if the entity is new, as the URI is the ID.
Trying to build a more complex version of a page using the layout builder, there are numerous issues with pieces of code assuming that the entity has a URI ID already.

Steps to reproduce

  • Create 2 bundles.
  • Set some kind of reference between the 2.
  • Set the one referencing the other, to use the layout builder to display the other as a link or as a full view mode.

Expected behavior: The sample value should not crash.

Actual behavior: template_preprocess_rdf_entity assumes that the entity has a canonical path (is not new, has ID) in $rdf_entity->toUrl('canonical'.
It also assumes there is an ID in rdf_entity_theme_suggestions_rdf_entity.

Proposed resolution

Add safechecks for these 2 cases.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡·Greece idimopoulos

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024