- Issue created by @steyep
The GoogleApiServiceClient
class defines a canonical link template but does not actually implement the route. So, if a module attempts to render the canonical route, they will get a "Route "entity.google_api_service_client.canonical" does not exist" exception.
More specifically: a site I'm working on has the
Next module β
installed. There is a hook that runs when an entity is created/updated/deleted that attempts get the canonical URL (here). This issue prevents google_api_service_client
entities from being deleted when used with the Next module.
- Create at least one google_api_service_client
entity
- Run the following with Drush:
( drush eval "$(cat)" ) <<-'PHP_CODE'
/** @var \Drupal\Core\Config\Entity\ConfigEntityStorageInterface $storage */
$storage = \Drupal::entityTypeManager()->getStorage('google_api_service_client');
$services = $storage->getQuery()->accessCheck(FALSE)->range(0, 1)->execute();
/** @var \Drupal\google_api_client\GoogleApiServiceClientInterface $client */
$client = $storage->load(array_key_first($services));
try {
$client->toUrl()->toString(TRUE)->getGeneratedUrl();
}
catch (\Exception $e) {
print 'Exception caught: ' . $e->getMessage() . PHP_EOL;
}
PHP_CODE
Remove the canonical link template
Active
4.3
Code