Problem/Motivation
When previewing changes to an entity that makes use of breadcrumbs, the rendered entity is an unsaved entity object different from the original one and doesn't have an ID, so calling toUrl() on it throws an EntityMalformedException: The "%s" entity cannot have a URI as it does not have an ID.
Proposed resolution
For the case where $entity->isNew(), build the breadcrumb by only using the homepage element and the current page element, if any of those are set. We could skip the breadcrumb entirely, but keeping it with a partly-valid value is better for design comparison purposes.
Issue fork custom_breadcrumbs-3618539
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
ts.ag commented