Its possible URLs are malformed when calling methods on an entity:
// Throws \Drupal\Core\Entity\Exception\UndefinedLinkTemplateException|\Drupal\Core\Entity\EntityMalformedException
$url = $entity->toUrl();
// Throws \UnexpectedValueException
$url->getInternalPath();
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3059012-catch-tourl-exceptions.patch | 1.27 KB | dpi |
Comments
Comment #2
dpiComment #3
jibranThis always bothered me. Nice catch. Pun intended ;-)
Comment #4
berdirThanks.