If you preview an entity who is not saved and a field with smartrim is filled, it returns:

Drupal\Core\Entity\EntityMalformedException: The "node" entity cannot have a URI as it does not have an ID in Drupal\Core\Entity\Entity->toUrl() (linea 179 di /var/www/teatro.it/core/lib/Drupal/Core/Entity/Entity.php).

CommentFileSizeAuthor
#2 smart_trim-2883027-2.patch1.8 KBaniaorome
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sedax created an issue. See original summary.

aniaorome’s picture

That comes from the fact that Smart trim tries to generate the link to the entity, but that doesn't exist yet.

Quickest solution is to check if the entity is new or not, and then generate the url only if the latter is true.

Chris Matthews’s picture

Assigned: csedax90 » Unassigned
Status: Active » Needs review
markie’s picture

Status: Needs review » Needs work

I think this issue has been addressed in another ticket, the check for an id is done. Can you confirm and close or re-roll against the current build

Anybody’s picture

Status: Needs work » Closed (cannot reproduce)

No reply since 3 years.