Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 300691

Entity::uriRelationships() throws exceptions if an URL cannot be generated because of missing mandatory parameters

$
0
0

Problem/Motivation

If there is a link template with mandatory parameters the url cannot be generated without providing those parameters. If we try to build the url without the mandatory parameters the exception Symfony\Component\Routing\Exception\MissingMandatoryParametersException will be thrown.

The entity predelete hook menu_link_content_entity_predelete introduced in #2350797: Orphaned menu links when nodes are deleted if menu_link_ui is not enabled is the one that introduced the problem by calling \Drupal\Core\Entity\EntityInterface::uriRelationships().

This might occur if the diff module is used and a link template like this is added:
"revisions-diff" = "/custom_entity/{custom_entity}/revision/{left_revision}/{right_revision}/{filter}"

This is a major as it prevents deleting entities having such link templates and there is no workaround for this.

Proposed resolution

\Drupal\Core\Entity\EntityInterface::uriRelationships() should catch exceptions of the type MissingMandatoryParametersException.

Remaining tasks

User interface changes

API changes

Data model changes


Viewing all articles
Browse latest Browse all 300691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>