Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.