- Issue created by @maskedjellybean
This issue came to light when using group in combination with the redirect module. When a redirect destination is a group content entity URI in the pattern "entity:group_content/7991", the list of redirects cannot be generated due this error:
Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("group") to generate a URL for route "entity.group_content.canonical". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 187 of /var/www/docroot/core/lib/Drupal/Core/Routing/UrlGenerator.php)
Moving backwards through the stacktrace reveals that when \Drupal\Core\Url::fromEntityUri
is called, the necessary group ID is not retrieved. This makes sense because it is not included in the entity URI. Based on this method, it would appear that a group content entity requiring more than one parameter to generate a URL is fundamentally incompatible with Drupal core. I don't see any way to alter \Drupal\Core\Url::fromEntityUri
to make it compatible with the group module.
I know I'm using a very outdated version of the group module. Has the ability to generate a Url object to a group content entity using the entity URI been resolved in a recent version?
\Drupal\Core\Url::fromUri
like this: $url = Url::fromUri('entity:group_content/GROUP_CONTENT_ID')
MissingMandatoryParametersException
exception.Active
1.6
Code